From 047c8b26dc2e37d8bb8b12576b8612664df0db2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 15:05:37 +0000 Subject: [PATCH 1/7] Initial plan From d3b5325389ba3b22cce988800803c7ab58f56a4b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 15:29:54 +0000 Subject: [PATCH 2/7] fix(http-client-csharp): complete integer collection JSON support Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../ModelSerializationExtensionsDefinition.cs | 7 +- .../Providers/ScmMethodProviderCollection.cs | 20 + ...bjectValueIncludesFileBinaryContentCase.cs | 5 +- ...ctValueXmlIncludesFileBinaryContentCase.cs | 5 +- .../Local.Tests/IntegerCollectionTests.cs | 165 + .../ModelSerializationExtensionsTests.cs | 25 + .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 38 + .../Generated/Int16Collections.RestClient.cs | 97 + .../src/Generated/Int16Collections.cs | 488 + .../Internal/ModelSerializationExtensions.cs | 5 +- .../src/Generated/SampleTypeSpecClient.cs | 28 + .../Generated/UInt16Collections.RestClient.cs | 97 + .../src/Generated/UInt16Collections.cs | 488 + .../Generated/UInt32Collections.RestClient.cs | 97 + .../src/Generated/UInt32Collections.cs | 488 + .../Generated/UInt64Collections.RestClient.cs | 97 + .../src/Generated/UInt64Collections.cs | 488 + .../Local/Sample-TypeSpec/tspCodeModel.json | 24714 +++++++++------- 18 files changed, 16798 insertions(+), 10554 deletions(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs index d2458620191..88361ec5d95 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs @@ -6,6 +6,7 @@ using System.Buffers.Text; using System.ClientModel; using System.ClientModel.Primitives; +using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -752,12 +753,12 @@ private MethodProvider BuildWriteObjectValueMethodGeneric() }, writer.WriteEndObject(), Break }), - // IEnumerable case - BuildWriteObjectValueSwitchCase(typeof(IEnumerable), "objectEnumerable", + // IEnumerable case + BuildWriteObjectValueSwitchCase(typeof(IEnumerable), "objectEnumerable", objectEnumerable => new MethodBodyStatement[] { writer.WriteStartArray(), - new ForEachStatement("item", objectEnumerable.As>(), out var item) + new ForEachStatement(typeof(object), "item", objectEnumerable, false, out var item) { writer.WriteObjectValue(item.As(), options) }, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 0f9ce24f420..4c4a74e001a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -788,8 +788,12 @@ private MethodBodyStatement GetFrameworkTypeConversionFromReader(CSharpType elem // Map framework types to their Utf8JsonReader method names var readerMethodName = frameworkType switch { + Type t when t == typeof(short) => nameof(Utf8JsonReader.GetInt16), + Type t when t == typeof(ushort) => nameof(Utf8JsonReader.GetUInt16), Type t when t == typeof(int) => nameof(Utf8JsonReader.GetInt32), + Type t when t == typeof(uint) => nameof(Utf8JsonReader.GetUInt32), Type t when t == typeof(long) => nameof(Utf8JsonReader.GetInt64), + Type t when t == typeof(ulong) => nameof(Utf8JsonReader.GetUInt64), Type t when t == typeof(bool) => nameof(Utf8JsonReader.GetBoolean), Type t when t == typeof(double) => nameof(Utf8JsonReader.GetDouble), Type t when t == typeof(float) => nameof(Utf8JsonReader.GetSingle), @@ -1056,10 +1060,18 @@ private static bool ShouldBuildStackVarForFrameworkType(CSharpType type) } return type.Equals(typeof(string)) || + type.Equals(typeof(short)) || + type.Equals(typeof(short?)) || + type.Equals(typeof(ushort)) || + type.Equals(typeof(ushort?)) || type.Equals(typeof(int)) || type.Equals(typeof(int?)) || + type.Equals(typeof(uint)) || + type.Equals(typeof(uint?)) || type.Equals(typeof(long)) || type.Equals(typeof(long?)) || + type.Equals(typeof(ulong)) || + type.Equals(typeof(ulong?)) || type.Equals(typeof(double)) || type.Equals(typeof(double?)) || type.Equals(typeof(float)) || @@ -1098,10 +1110,18 @@ private static bool IsConvertibleFromBinaryData(CSharpType type) } return type.Equals(typeof(string)) || + type.Equals(typeof(short)) || + type.Equals(typeof(short?)) || + type.Equals(typeof(ushort)) || + type.Equals(typeof(ushort?)) || type.Equals(typeof(int)) || type.Equals(typeof(int?)) || + type.Equals(typeof(uint)) || + type.Equals(typeof(uint?)) || type.Equals(typeof(long)) || type.Equals(typeof(long?)) || + type.Equals(typeof(ulong)) || + type.Equals(typeof(ulong?)) || type.Equals(typeof(double)) || type.Equals(typeof(double?)) || type.Equals(typeof(float)) || diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs index c2e19479062..1213ca8f10a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Collections; using System.Collections.Generic; using System.Text.Json; @@ -89,9 +90,9 @@ public static void WriteObjectValue(this global::System.Text.Json.Utf8JsonWri } writer.WriteEndObject(); break; - case global::System.Collections.Generic.IEnumerable objectEnumerable: + case global::System.Collections.IEnumerable objectEnumerable: writer.WriteStartArray(); - foreach (var item in objectEnumerable) + foreach (object item in objectEnumerable) { writer.WriteObjectValue(item, options); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs index 2750bd7a310..62f1ef10871 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Text.Json; @@ -91,9 +92,9 @@ public static void WriteObjectValue(this global::System.Text.Json.Utf8JsonWri } writer.WriteEndObject(); break; - case global::System.Collections.Generic.IEnumerable objectEnumerable: + case global::System.Collections.IEnumerable objectEnumerable: writer.WriteStartArray(); - foreach (var item in objectEnumerable) + foreach (object item in objectEnumerable) { writer.WriteObjectValue(item, options); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs new file mode 100644 index 00000000000..a78a01dde46 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using NUnit.Framework; +using SampleTypeSpec; + +namespace TestProjects.Local.Tests +{ + public class IntegerCollectionTests + { + [Test] + public Task Int16Collections( + [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, + [Values(false, true)] bool isAsync) + { + var handler = new CollectionHandler(); + var client = new Int16Collections(CreatePipeline(handler), new Uri("https://example.com")); + return VerifyCollections(handler, shape, [short.MinValue, 0, short.MaxValue], "-32768,0,32767", "32768", + body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), + body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), + () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), + () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), + () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), + () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); + } + + [Test] + public Task UInt16Collections( + [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, + [Values(false, true)] bool isAsync) + { + var handler = new CollectionHandler(); + var client = new UInt16Collections(CreatePipeline(handler), new Uri("https://example.com")); + return VerifyCollections(handler, shape, [0, 1, ushort.MaxValue], "0,1,65535", "-1", + body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), + body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), + () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), + () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), + () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), + () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); + } + + [Test] + public Task UInt32Collections( + [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, + [Values(false, true)] bool isAsync) + { + var handler = new CollectionHandler(); + var client = new UInt32Collections(CreatePipeline(handler), new Uri("https://example.com")); + return VerifyCollections(handler, shape, [0, 1, uint.MaxValue], "0,1,4294967295", "-1", + body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), + body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), + () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), + () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), + () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), + () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); + } + + [Test] + public Task UInt64Collections( + [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, + [Values(false, true)] bool isAsync) + { + var handler = new CollectionHandler(); + var client = new UInt64Collections(CreatePipeline(handler), new Uri("https://example.com")); + return VerifyCollections(handler, shape, [0, 1, ulong.MaxValue], "0,1,18446744073709551615", "-1", + body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), + body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), + () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), + () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), + () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), + () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); + } + + private static async Task VerifyCollections( + CollectionHandler handler, string shape, T[] values, string numbers, string invalidNumber, + Func>, Task> sendNested, + Func>, Task> sendRecord, + Func>>> getArray, + Func>>> getRecord, + Func>>> getNullableArray, + Func>>> getNullableRecord) where T : struct + { + using (handler) + { + switch (shape) + { + case "nested": + await sendNested([new List(values), Array.Empty()]); + Assert.AreEqual($"[[{numbers}],[]]", handler.RequestBody); + break; + case "record-of-arrays": + await sendRecord(new Dictionary> { ["numbers"] = values, ["empty"] = new List() }); + Assert.AreEqual($"{{\"numbers\":[{numbers}],\"empty\":[]}}", handler.RequestBody); + break; + case "array": + handler.ResponseBody = $"[{numbers}]"; + CollectionAssert.AreEqual(values, (await getArray()).Value); + handler.ResponseBody = "[]"; + Assert.IsEmpty((await getArray()).Value); + handler.ResponseBody = $"[{invalidNumber}]"; + Assert.ThrowsAsync(async () => await getArray()); + break; + case "record": + handler.ResponseBody = $"{{\"first\":{numbers.Split(',')[0]},\"last\":{numbers.Split(',')[2]}}}"; + var record = (await getRecord()).Value; + Assert.AreEqual(2, record.Count); + Assert.AreEqual(values[0], record["first"]); + Assert.AreEqual(values[2], record["last"]); + handler.ResponseBody = "{}"; + Assert.IsEmpty((await getRecord()).Value); + handler.ResponseBody = $"{{\"invalid\":{invalidNumber}}}"; + Assert.ThrowsAsync(async () => await getRecord()); + break; + case "nullable-array": + handler.ResponseBody = $"[null,{numbers},null]"; + CollectionAssert.AreEqual(new T?[] { null }.Concat(values.Select(v => (T?)v)).Append(null), (await getNullableArray()).Value); + break; + case "nullable-record": + handler.ResponseBody = $"{{\"first\":{numbers.Split(',')[0]},\"missing\":null,\"last\":{numbers.Split(',')[2]}}}"; + var nullableRecord = (await getNullableRecord()).Value; + Assert.AreEqual(3, nullableRecord.Count); + Assert.AreEqual(values[0], nullableRecord["first"]); + Assert.IsNull(nullableRecord["missing"]); + Assert.AreEqual(values[2], nullableRecord["last"]); + break; + default: + Assert.Fail($"Unexpected collection shape: {shape}"); + break; + } + } + } + + private static ClientPipeline CreatePipeline(CollectionHandler handler) + => ClientPipeline.Create(new ClientPipelineOptions { Transport = new HttpClientPipelineTransport(new HttpClient(handler)) }); + + private sealed class CollectionHandler : HttpMessageHandler + { + public string? RequestBody { get; private set; } + public string ResponseBody { get; set; } = "{}"; + + protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) + { + RequestBody = request.Content?.ReadAsStringAsync(cancellationToken).GetAwaiter().GetResult(); + return new HttpResponseMessage(request.Method == HttpMethod.Post ? HttpStatusCode.NoContent : HttpStatusCode.OK) + { + Content = new StringContent(ResponseBody, Encoding.UTF8, "application/json") + }; + } + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + => Task.FromResult(Send(request, cancellationToken)); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs index 4a0f2033518..951b3b46c3d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs @@ -34,6 +34,31 @@ public void WriteObjectValuePreservesIntegerRange(object value, string expected) Assert.AreEqual(expected, Encoding.UTF8.GetString(buffer.WrittenSpan)); } + [Test] + public void WriteObjectValuePreservesDictionaryAndByteArrayHandling() + { + var buffer = new ArrayBufferWriter(); + using var writer = new Utf8JsonWriter(buffer); + + writer.WriteObjectValue(new Dictionary + { + ["bytes"] = new byte[] { 0, 1, 255 }, + ["nested"] = new Dictionary { ["count"] = 1 } + }); + writer.Flush(); + + Assert.AreEqual("""{"bytes":"AAH/","nested":{"count":1}}""", Encoding.UTF8.GetString(buffer.WrittenSpan)); + } + + [Test] + public void WriteObjectValueRejectsUnsupportedCollectionElements() + { + var buffer = new ArrayBufferWriter(); + using var writer = new Utf8JsonWriter(buffer); + + Assert.Throws(() => writer.WriteObjectValue(new[] { new object() })); + } + [TestCase("{ \"text\": \"こんにちは 🌍\", \"escaped\": \"\\u0061\" }")] [TestCase("[1, true, null, {\"nested\": []}]")] [TestCase("\"hello\"")] diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 8c4ec4b4b74..4ebae1d1427 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -1130,3 +1130,41 @@ op getAcronymParameters( @post @convenientAPI(true, "csharp") op setAcronymAddresses(@query ipV4Address: string, @query ipV6Address?: string): void; + +interface IntegerCollections { + @route("/nested-array") + @post + sendNested(@body body: T[][]): void; + + @route("/record-of-arrays") + @post + sendRecord(@body body: Record): void; + + @route("/array") + @get + getArray(): T[]; + + @route("/record") + @get + getRecord(): Record; + + @route("/nullable-array") + @get + getNullableArray(): (T | null)[]; + + @route("/nullable-record") + @get + getNullableRecord(): Record; +} + +@route("/int16-collections") +interface Int16Collections extends IntegerCollections {} + +@route("/uint16-collections") +interface UInt16Collections extends IntegerCollections {} + +@route("/uint32-collections") +interface UInt32Collections extends IntegerCollections {} + +@route("/uint64-collections") +interface UInt64Collections extends IntegerCollections {} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs new file mode 100644 index 00000000000..6759cc8dd2b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace SampleTypeSpec +{ + /// + public partial class Int16Collections + { + private static PipelineMessageClassifier _pipelineMessageClassifier200; + private static PipelineMessageClassifier _pipelineMessageClassifier204; + + private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); + + private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); + + internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int16-collections/nested-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int16-collections/record-of-arrays", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int16-collections/array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int16-collections/record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int16-collections/nullable-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int16-collections/nullable-record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs new file mode 100644 index 00000000000..8e078f83832 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace SampleTypeSpec +{ + /// The Int16Collections sub-client. + public partial class Int16Collections + { + private readonly Uri _endpoint; + + /// Initializes a new instance of Int16Collections for mocking. + protected Int16Collections() + { + } + + /// Initializes a new instance of Int16Collections. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + internal Int16Collections(ClientPipeline pipeline, Uri endpoint) + { + _endpoint = endpoint; + Pipeline = pipeline; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public ClientPipeline Pipeline { get; } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return SendNested(content, cancellationToken.ToRequestOptions()); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return SendRecord(content, cancellationToken.ToRequestOptions()); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetArray(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableArray(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs index 6188b0f9ac7..a21365f4814 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs @@ -9,6 +9,7 @@ using System.Buffers; using System.Buffers.Text; using System.ClientModel.Primitives; +using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -318,9 +319,9 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, T value, Mode } writer.WriteEndObject(); break; - case IEnumerable objectEnumerable: + case IEnumerable objectEnumerable: writer.WriteStartArray(); - foreach (var item in objectEnumerable) + foreach (object item in objectEnumerable) { writer.WriteObjectValue(item, options); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 5a2f9236818..1be70298ddc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -41,6 +41,10 @@ public partial class SampleTypeSpecClient private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; private PlantOperations _cachedPlantOperations; + private Int16Collections _cachedInt16Collections; + private UInt16Collections _cachedUInt16Collections; + private UInt32Collections _cachedUInt32Collections; + private UInt64Collections _cachedUInt64Collections; /// Initializes a new instance of SampleTypeSpecClient for mocking. protected SampleTypeSpecClient() @@ -2307,5 +2311,29 @@ public virtual Notebooks GetNotebooksClient(string notebook) return new Notebooks(Pipeline, _endpoint, notebook); } + + /// Initializes a new instance of Int16Collections. + public virtual Int16Collections GetInt16CollectionsClient() + { + return Volatile.Read(ref _cachedInt16Collections) ?? Interlocked.CompareExchange(ref _cachedInt16Collections, new Int16Collections(Pipeline, _endpoint), null) ?? _cachedInt16Collections; + } + + /// Initializes a new instance of UInt16Collections. + public virtual UInt16Collections GetUInt16CollectionsClient() + { + return Volatile.Read(ref _cachedUInt16Collections) ?? Interlocked.CompareExchange(ref _cachedUInt16Collections, new UInt16Collections(Pipeline, _endpoint), null) ?? _cachedUInt16Collections; + } + + /// Initializes a new instance of UInt32Collections. + public virtual UInt32Collections GetUInt32CollectionsClient() + { + return Volatile.Read(ref _cachedUInt32Collections) ?? Interlocked.CompareExchange(ref _cachedUInt32Collections, new UInt32Collections(Pipeline, _endpoint), null) ?? _cachedUInt32Collections; + } + + /// Initializes a new instance of UInt64Collections. + public virtual UInt64Collections GetUInt64CollectionsClient() + { + return Volatile.Read(ref _cachedUInt64Collections) ?? Interlocked.CompareExchange(ref _cachedUInt64Collections, new UInt64Collections(Pipeline, _endpoint), null) ?? _cachedUInt64Collections; + } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs new file mode 100644 index 00000000000..66bd7275486 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace SampleTypeSpec +{ + /// + public partial class UInt16Collections + { + private static PipelineMessageClassifier _pipelineMessageClassifier200; + private static PipelineMessageClassifier _pipelineMessageClassifier204; + + private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); + + private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); + + internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint16-collections/nested-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint16-collections/record-of-arrays", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint16-collections/array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint16-collections/record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint16-collections/nullable-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint16-collections/nullable-record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs new file mode 100644 index 00000000000..30775a12449 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace SampleTypeSpec +{ + /// The UInt16Collections sub-client. + public partial class UInt16Collections + { + private readonly Uri _endpoint; + + /// Initializes a new instance of UInt16Collections for mocking. + protected UInt16Collections() + { + } + + /// Initializes a new instance of UInt16Collections. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + internal UInt16Collections(ClientPipeline pipeline, Uri endpoint) + { + _endpoint = endpoint; + Pipeline = pipeline; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public ClientPipeline Pipeline { get; } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return SendNested(content, cancellationToken.ToRequestOptions()); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return SendRecord(content, cancellationToken.ToRequestOptions()); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetArray(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableArray(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs new file mode 100644 index 00000000000..cc5ddd3f084 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace SampleTypeSpec +{ + /// + public partial class UInt32Collections + { + private static PipelineMessageClassifier _pipelineMessageClassifier200; + private static PipelineMessageClassifier _pipelineMessageClassifier204; + + private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); + + private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); + + internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint32-collections/nested-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint32-collections/record-of-arrays", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint32-collections/array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint32-collections/record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint32-collections/nullable-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint32-collections/nullable-record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs new file mode 100644 index 00000000000..80d8f1b3abb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace SampleTypeSpec +{ + /// The UInt32Collections sub-client. + public partial class UInt32Collections + { + private readonly Uri _endpoint; + + /// Initializes a new instance of UInt32Collections for mocking. + protected UInt32Collections() + { + } + + /// Initializes a new instance of UInt32Collections. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + internal UInt32Collections(ClientPipeline pipeline, Uri endpoint) + { + _endpoint = endpoint; + Pipeline = pipeline; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public ClientPipeline Pipeline { get; } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return SendNested(content, cancellationToken.ToRequestOptions()); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return SendRecord(content, cancellationToken.ToRequestOptions()); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetArray(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableArray(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs new file mode 100644 index 00000000000..abe73b3860e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace SampleTypeSpec +{ + /// + public partial class UInt64Collections + { + private static PipelineMessageClassifier _pipelineMessageClassifier200; + private static PipelineMessageClassifier _pipelineMessageClassifier204; + + private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); + + private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); + + internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint64-collections/nested-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint64-collections/record-of-arrays", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); + PipelineRequest request = message.Request; + request.Headers.Set("Content-Type", "application/json"); + request.Content = content; + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint64-collections/array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint64-collections/record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint64-collections/nullable-array", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + + internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/uint64-collections/nullable-record", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs new file mode 100644 index 00000000000..bd1b62930f2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace SampleTypeSpec +{ + /// The UInt64Collections sub-client. + public partial class UInt64Collections + { + private readonly Uri _endpoint; + + /// Initializes a new instance of UInt64Collections for mocking. + protected UInt64Collections() + { + } + + /// Initializes a new instance of UInt64Collections. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + internal UInt64Collections(ClientPipeline pipeline, Uri endpoint) + { + _endpoint = endpoint; + Pipeline = pipeline; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public ClientPipeline Pipeline { get; } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendNested + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendNestedRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return SendNested(content, cancellationToken.ToRequestOptions()); + } + + /// SendNested. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromEnumerable(body); + return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] SendRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateSendRecordRequest(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return SendRecord(content, cancellationToken.ToRequestOptions()); + } + + /// SendRecord. + /// + /// The cancellation token that can be used to cancel the operation. + /// is null. + /// Service returned a non-success status code. + public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using BinaryContent content = BinaryContentHelper.FromDictionary(body); + return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetArray(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableArray(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableArray + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableArrayAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableArrayRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// GetNullableArray. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + List value = new List(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndArray) + { + break; + } + value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetNullableRecord(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] GetNullableRecord + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetNullableRecordAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetNullableRecordRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) + { + ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + + /// GetNullableRecord. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + IDictionary value = new Dictionary(); + BinaryData data = result.GetRawResponse().Content; + Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if (jsonReader.TokenType == JsonTokenType.EndObject) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); + } + return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 1867d5cfa83..79013cdbbdc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -2970,454 +2970,1944 @@ "value": "application/json", "decorators": [], "isExactName": false + }, + { + "$id": "294", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType48", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "296", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType49", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "298", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType50", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "300", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType51", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "302", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType52", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "304", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType53", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "306", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType54", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "308", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType55", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "310", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType56", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "312", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType57", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "314", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType58", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "316", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType59", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "318", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType60", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "320", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType61", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "322", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType62", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "324", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType63", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "326", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType64", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "328", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType65", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "330", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType66", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "332", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType67", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "334", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType68", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "336", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType69", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "338", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType70", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "340", + "kind": "constant", + "name": "GetTreeAsJsonResponseContentType71", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false } ], "models": [ { - "$id": "294", + "$id": "342", + "kind": "model", + "name": "Thing", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Thing", + "usage": "Input,Output,Spread,Json", + "doc": "A model with a few properties of literal types", + "decorators": [], + "serializationOptions": { + "json": { + "name": "Thing" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "343", + "kind": "property", + "name": "name", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "name", + "doc": "name of the Thing", + "type": { + "$id": "344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "345", + "kind": "property", + "name": "requiredUnion", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredUnion", + "doc": "required Union", + "type": { + "$id": "346", + "kind": "union", + "name": "ThingRequiredUnion", + "variantTypes": [ + { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "348", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + { + "$id": "350", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + ], + "namespace": "SampleTypeSpec", + "decorators": [], + "isExactName": false + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredUnion", + "serializationOptions": { + "json": { + "name": "requiredUnion" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "351", + "kind": "property", + "name": "requiredLiteralString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredLiteralString", + "doc": "required literal string", + "type": { + "$ref": "100" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralString", + "serializationOptions": { + "json": { + "name": "requiredLiteralString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "352", + "kind": "property", + "name": "requiredNullableString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredNullableString", + "doc": "required nullable string", + "type": { + "$id": "353", + "kind": "nullable", + "type": { + "$id": "354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredNullableString", + "serializationOptions": { + "json": { + "name": "requiredNullableString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "355", + "kind": "property", + "name": "optionalNullableString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalNullableString", + "doc": "required optional string", + "type": { + "$id": "356", + "kind": "nullable", + "type": { + "$id": "357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalNullableString", + "serializationOptions": { + "json": { + "name": "optionalNullableString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "358", + "kind": "property", + "name": "requiredLiteralInt", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredLiteralInt", + "doc": "required literal int", + "type": { + "$ref": "102" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralInt", + "serializationOptions": { + "json": { + "name": "requiredLiteralInt" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "359", + "kind": "property", + "name": "requiredLiteralFloat", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredLiteralFloat", + "doc": "required literal float", + "type": { + "$ref": "104" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralFloat", + "serializationOptions": { + "json": { + "name": "requiredLiteralFloat" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "360", + "kind": "property", + "name": "requiredLiteralBool", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredLiteralBool", + "doc": "required literal bool", + "type": { + "$ref": "106" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralBool", + "serializationOptions": { + "json": { + "name": "requiredLiteralBool" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "361", + "kind": "property", + "name": "optionalLiteralString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalLiteralString", + "doc": "optional literal string", + "type": { + "$ref": "1" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralString", + "serializationOptions": { + "json": { + "name": "optionalLiteralString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "362", + "kind": "property", + "name": "requiredNullableLiteralString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredNullableLiteralString", + "doc": "required nullable literal string", + "type": { + "$id": "363", + "kind": "nullable", + "type": { + "$ref": "5" + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredNullableLiteralString", + "serializationOptions": { + "json": { + "name": "requiredNullableLiteralString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "364", + "kind": "property", + "name": "optionalLiteralInt", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalLiteralInt", + "doc": "optional literal int", + "type": { + "$ref": "9" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralInt", + "serializationOptions": { + "json": { + "name": "optionalLiteralInt" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "365", + "kind": "property", + "name": "optionalLiteralFloat", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalLiteralFloat", + "doc": "optional literal float", + "type": { + "$ref": "13" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralFloat", + "serializationOptions": { + "json": { + "name": "optionalLiteralFloat" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "366", + "kind": "property", + "name": "optionalLiteralBool", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalLiteralBool", + "doc": "optional literal bool", + "type": { + "$ref": "108" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralBool", + "serializationOptions": { + "json": { + "name": "optionalLiteralBool" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "367", + "kind": "property", + "name": "requiredBadDescription", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredBadDescription", + "doc": "description with xml <|endoftext|>", + "type": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredBadDescription", + "serializationOptions": { + "json": { + "name": "requiredBadDescription" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "369", + "kind": "property", + "name": "optionalNullableList", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalNullableList", + "doc": "optional nullable collection", + "type": { + "$id": "370", + "kind": "nullable", + "type": { + "$id": "371", + "kind": "array", + "name": "Array1", + "valueType": { + "$id": "372", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalNullableList", + "serializationOptions": { + "json": { + "name": "optionalNullableList" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "373", + "kind": "property", + "name": "requiredNullableList", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredNullableList", + "doc": "required nullable collection", + "type": { + "$id": "374", + "kind": "nullable", + "type": { + "$ref": "371" + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredNullableList", + "serializationOptions": { + "json": { + "name": "requiredNullableList" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "375", + "kind": "property", + "name": "propertyWithSpecialDocs", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "propertyWithSpecialDocs", + "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", + "type": { + "$id": "376", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Thing.propertyWithSpecialDocs", + "serializationOptions": { + "json": { + "name": "propertyWithSpecialDocs" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "377", "kind": "model", - "name": "Thing", + "name": "RoundTripModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Thing", - "usage": "Input,Output,Spread,Json", - "doc": "A model with a few properties of literal types", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel", + "usage": "Input,Output,Json", + "doc": "this is a roundtrip model", "decorators": [], "serializationOptions": { "json": { - "name": "Thing" + "name": "RoundTripModel" } }, "isExactName": false, "properties": [ { - "$id": "295", + "$id": "378", + "kind": "property", + "name": "requiredString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredString", + "doc": "Required string, illustrating a reference type property.", + "type": { + "$id": "379", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredString", + "serializationOptions": { + "json": { + "name": "requiredString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "380", + "kind": "property", + "name": "requiredInt", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredInt", + "doc": "Required int, illustrating a value type property.", + "type": { + "$id": "381", + "kind": "int32", + "name": "int32", + "encode": "string", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredInt", + "serializationOptions": { + "json": { + "name": "requiredInt" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "382", + "kind": "property", + "name": "requiredCollection", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredCollection", + "doc": "Required collection of enums", + "type": { + "$id": "383", + "kind": "array", + "name": "ArrayStringFixedEnum", + "valueType": { + "$ref": "17" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredCollection", + "serializationOptions": { + "json": { + "name": "requiredCollection" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "384", + "kind": "property", + "name": "requiredDictionary", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredDictionary", + "doc": "Required dictionary of enums", + "type": { + "$id": "385", + "kind": "dict", + "keyType": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "27" + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredDictionary", + "serializationOptions": { + "json": { + "name": "requiredDictionary" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "387", + "kind": "property", + "name": "requiredModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredModel", + "doc": "Required model", + "type": { + "$ref": "342" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredModel", + "serializationOptions": { + "json": { + "name": "requiredModel" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "388", + "kind": "property", + "name": "intExtensibleEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "intExtensibleEnum", + "doc": "this is an int based extensible enum", + "type": { + "$ref": "37" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intExtensibleEnum", + "serializationOptions": { + "json": { + "name": "intExtensibleEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "389", + "kind": "property", + "name": "intExtensibleEnumCollection", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "intExtensibleEnumCollection", + "doc": "this is a collection of int based extensible enum", + "type": { + "$id": "390", + "kind": "array", + "name": "ArrayIntExtensibleEnum", + "valueType": { + "$ref": "37" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intExtensibleEnumCollection", + "serializationOptions": { + "json": { + "name": "intExtensibleEnumCollection" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "391", + "kind": "property", + "name": "floatExtensibleEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "floatExtensibleEnum", + "doc": "this is a float based extensible enum", + "type": { + "$ref": "42" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatExtensibleEnum", + "serializationOptions": { + "json": { + "name": "floatExtensibleEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "392", "kind": "property", - "name": "name", + "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "name", - "doc": "name of the Thing", + "serializedName": "floatExtensibleEnumWithIntValue", + "doc": "this is a float based extensible enum", "type": { - "$id": "296", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$ref": "47" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatExtensibleEnumWithIntValue", + "serializationOptions": { + "json": { + "name": "floatExtensibleEnumWithIntValue" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "393", + "kind": "property", + "name": "floatExtensibleEnumCollection", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "floatExtensibleEnumCollection", + "doc": "this is a collection of float based extensible enum", + "type": { + "$id": "394", + "kind": "array", + "name": "ArrayFloatExtensibleEnum", + "valueType": { + "$ref": "42" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.name", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatExtensibleEnumCollection", "serializationOptions": { "json": { - "name": "name" + "name": "floatExtensibleEnumCollection" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "297", + "$id": "395", "kind": "property", - "name": "requiredUnion", + "name": "floatFixedEnum", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredUnion", - "doc": "required Union", + "serializedName": "floatFixedEnum", + "doc": "this is a float based fixed enum", "type": { - "$id": "298", - "kind": "union", - "name": "ThingRequiredUnion", - "variantTypes": [ - { - "$id": "299", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "300", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "301", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - { - "$id": "302", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - ], - "namespace": "SampleTypeSpec", - "decorators": [], - "isExactName": false + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatFixedEnum", + "serializationOptions": { + "json": { + "name": "floatFixedEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "396", + "kind": "property", + "name": "floatFixedEnumWithIntValue", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "floatFixedEnumWithIntValue", + "doc": "this is a float based fixed enum", + "type": { + "$ref": "57" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatFixedEnumWithIntValue", + "serializationOptions": { + "json": { + "name": "floatFixedEnumWithIntValue" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "397", + "kind": "property", + "name": "floatFixedEnumCollection", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "floatFixedEnumCollection", + "doc": "this is a collection of float based fixed enum", + "type": { + "$id": "398", + "kind": "array", + "name": "ArrayFloatFixedEnum", + "valueType": { + "$ref": "52" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatFixedEnumCollection", + "serializationOptions": { + "json": { + "name": "floatFixedEnumCollection" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "399", + "kind": "property", + "name": "intFixedEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "intFixedEnum", + "doc": "this is a int based fixed enum", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intFixedEnum", + "serializationOptions": { + "json": { + "name": "intFixedEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "400", + "kind": "property", + "name": "intFixedEnumCollection", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "intFixedEnumCollection", + "doc": "this is a collection of int based fixed enum", + "type": { + "$id": "401", + "kind": "array", + "name": "ArrayIntFixedEnum", + "valueType": { + "$ref": "62" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intFixedEnumCollection", + "serializationOptions": { + "json": { + "name": "intFixedEnumCollection" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "402", + "kind": "property", + "name": "stringFixedEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "stringFixedEnum", + "doc": "this is a string based fixed enum", + "type": { + "$ref": "17" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.stringFixedEnum", + "serializationOptions": { + "json": { + "name": "stringFixedEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "403", + "kind": "property", + "name": "requiredUnknown", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredUnknown", + "doc": "required unknown", + "type": { + "$id": "404", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredUnion", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredUnknown", "serializationOptions": { "json": { - "name": "requiredUnion" + "name": "requiredUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "303", + "$id": "405", "kind": "property", - "name": "requiredLiteralString", + "name": "optionalUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredLiteralString", - "doc": "required literal string", + "serializedName": "optionalUnknown", + "doc": "optional unknown", "type": { - "$ref": "100" + "$id": "406", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralString", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.optionalUnknown", "serializationOptions": { "json": { - "name": "requiredLiteralString" + "name": "optionalUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "304", + "$id": "407", "kind": "property", - "name": "requiredNullableString", + "name": "requiredRecordUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredNullableString", - "doc": "required nullable string", + "serializedName": "requiredRecordUnknown", + "doc": "required record of unknown", "type": { - "$id": "305", - "kind": "nullable", - "type": { - "$id": "306", + "$id": "408", + "kind": "dict", + "keyType": { + "$id": "409", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "namespace": "SampleTypeSpec" + "valueType": { + "$id": "410", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredNullableString", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredRecordUnknown", "serializationOptions": { "json": { - "name": "requiredNullableString" + "name": "requiredRecordUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "307", + "$id": "411", "kind": "property", - "name": "optionalNullableString", + "name": "optionalRecordUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalNullableString", - "doc": "required optional string", + "serializedName": "optionalRecordUnknown", + "doc": "optional record of unknown", "type": { - "$id": "308", - "kind": "nullable", - "type": { - "$id": "309", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" + "$ref": "408" }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalNullableString", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.optionalRecordUnknown", "serializationOptions": { "json": { - "name": "optionalNullableString" + "name": "optionalRecordUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "310", + "$id": "412", "kind": "property", - "name": "requiredLiteralInt", + "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredLiteralInt", - "doc": "required literal int", + "serializedName": "readOnlyRequiredRecordUnknown", + "doc": "required readonly record of unknown", "type": { - "$ref": "102" + "$ref": "408" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralInt", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.readOnlyRequiredRecordUnknown", "serializationOptions": { "json": { - "name": "requiredLiteralInt" + "name": "readOnlyRequiredRecordUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "311", + "$id": "413", "kind": "property", - "name": "requiredLiteralFloat", + "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredLiteralFloat", - "doc": "required literal float", + "serializedName": "readOnlyOptionalRecordUnknown", + "doc": "optional readonly record of unknown", "type": { - "$ref": "104" + "$ref": "408" }, - "optional": false, - "readOnly": false, + "optional": true, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralFloat", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.readOnlyOptionalRecordUnknown", "serializationOptions": { "json": { - "name": "requiredLiteralFloat" + "name": "readOnlyOptionalRecordUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "312", + "$id": "414", "kind": "property", - "name": "requiredLiteralBool", + "name": "modelWithRequiredNullable", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredLiteralBool", - "doc": "required literal bool", + "serializedName": "modelWithRequiredNullable", + "doc": "this is a model with required nullable properties", "type": { - "$ref": "106" + "$id": "415", + "kind": "model", + "name": "ModelWithRequiredNullableProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties", + "usage": "Input,Output,Json", + "doc": "A model with a few required nullable properties", + "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelWithRequiredNullableProperties" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "416", + "kind": "property", + "name": "requiredNullablePrimitive", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredNullablePrimitive", + "doc": "required nullable primitive type", + "type": { + "$id": "417", + "kind": "nullable", + "type": { + "$id": "418", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.requiredNullablePrimitive", + "serializationOptions": { + "json": { + "name": "requiredNullablePrimitive" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "419", + "kind": "property", + "name": "requiredExtensibleEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredExtensibleEnum", + "doc": "required nullable extensible enum type", + "type": { + "$id": "420", + "kind": "nullable", + "type": { + "$ref": "27" + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.requiredExtensibleEnum", + "serializationOptions": { + "json": { + "name": "requiredExtensibleEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "421", + "kind": "property", + "name": "requiredFixedEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "requiredFixedEnum", + "doc": "required nullable fixed enum type", + "type": { + "$id": "422", + "kind": "nullable", + "type": { + "$ref": "17" + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.requiredFixedEnum", + "serializationOptions": { + "json": { + "name": "requiredFixedEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "423", + "kind": "property", + "name": "fixedUnion", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "fixedUnion", + "type": { + "$ref": "72" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.fixedUnion", + "serializationOptions": { + "json": { + "name": "fixedUnion" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "424", + "kind": "property", + "name": "numericEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "numericEnum", + "type": { + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.numericEnum", + "serializationOptions": { + "json": { + "name": "numericEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredLiteralBool", - "serializationOptions": { - "json": { - "name": "requiredLiteralBool" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "313", - "kind": "property", - "name": "optionalLiteralString", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalLiteralString", - "doc": "optional literal string", - "type": { - "$ref": "1" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralString", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.modelWithRequiredNullable", "serializationOptions": { "json": { - "name": "optionalLiteralString" + "name": "modelWithRequiredNullable" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "314", + "$id": "425", "kind": "property", - "name": "requiredNullableLiteralString", + "name": "requiredBytes", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredNullableLiteralString", - "doc": "required nullable literal string", + "serializedName": "requiredBytes", + "doc": "Required bytes", "type": { - "$id": "315", - "kind": "nullable", - "type": { - "$ref": "5" - }, - "namespace": "SampleTypeSpec" + "$id": "426", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredNullableLiteralString", - "serializationOptions": { - "json": { - "name": "requiredNullableLiteralString" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "316", - "kind": "property", - "name": "optionalLiteralInt", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalLiteralInt", - "doc": "optional literal int", - "type": { - "$ref": "9" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralInt", - "serializationOptions": { - "json": { - "name": "optionalLiteralInt" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "317", - "kind": "property", - "name": "optionalLiteralFloat", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalLiteralFloat", - "doc": "optional literal float", - "type": { - "$ref": "13" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralFloat", - "serializationOptions": { - "json": { - "name": "optionalLiteralFloat" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "318", - "kind": "property", - "name": "optionalLiteralBool", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalLiteralBool", - "doc": "optional literal bool", - "type": { - "$ref": "108" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalLiteralBool", + "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredBytes", "serializationOptions": { "json": { - "name": "optionalLiteralBool" + "name": "requiredBytes" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$ref": "415" + }, + { + "$id": "427", + "kind": "model", + "name": "Wrapper", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper", + "usage": "Input", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, + "properties": [ { - "$id": "319", + "$id": "428", "kind": "property", - "name": "requiredBadDescription", + "name": "p1", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredBadDescription", - "doc": "description with xml <|endoftext|>", + "doc": "header parameter", "type": { - "$id": "320", + "$id": "429", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3428,102 +4918,93 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredBadDescription", - "serializationOptions": { - "json": { - "name": "requiredBadDescription" - } - }, - "isHttpMetadata": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p1", + "serializationOptions": {}, + "isHttpMetadata": true, "isExactName": false }, { - "$id": "321", + "$id": "430", "kind": "property", - "name": "optionalNullableList", + "name": "action", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalNullableList", - "doc": "optional nullable collection", + "doc": "body parameter", "type": { - "$id": "322", - "kind": "nullable", - "type": { - "$id": "323", - "kind": "array", - "name": "Array1", - "valueType": { - "$id": "324", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" + "$ref": "377" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.optionalNullableList", - "serializationOptions": { - "json": { - "name": "optionalNullableList" - } - }, + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.action", + "serializationOptions": {}, "isHttpMetadata": false, "isExactName": false }, { - "$id": "325", + "$id": "431", "kind": "property", - "name": "requiredNullableList", + "name": "p2", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredNullableList", - "doc": "required nullable collection", + "doc": "path parameter", "type": { - "$id": "326", - "kind": "nullable", - "type": { - "$ref": "323" - }, - "namespace": "SampleTypeSpec" + "$id": "432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.requiredNullableList", - "serializationOptions": { - "json": { - "name": "requiredNullableList" - } - }, - "isHttpMetadata": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p2", + "serializationOptions": {}, + "isHttpMetadata": true, "isExactName": false - }, + } + ] + }, + { + "$id": "433", + "kind": "model", + "name": "Friend", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.NotFriend", + "usage": "Output,Spread,Json", + "doc": "this is not a friendly model but with a friendly name", + "decorators": [], + "serializationOptions": { + "json": { + "name": "NotFriend" + } + }, + "isExactName": false, + "properties": [ { - "$id": "327", + "$id": "434", "kind": "property", - "name": "propertyWithSpecialDocs", + "name": "name", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "propertyWithSpecialDocs", - "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", + "serializedName": "name", + "doc": "name of the NotFriend", "type": { - "$id": "328", + "$id": "435", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3534,10 +5015,10 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Thing.propertyWithSpecialDocs", + "crossLanguageDefinitionId": "SampleTypeSpec.NotFriend.name", "serializationOptions": { "json": { - "name": "propertyWithSpecialDocs" + "name": "name" } }, "isHttpMetadata": false, @@ -3546,37 +5027,37 @@ ] }, { - "$id": "329", + "$id": "436", "kind": "model", - "name": "RoundTripModel", + "name": "RenamedModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel", - "usage": "Input,Output,Json", - "doc": "this is a roundtrip model", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithClientName", + "usage": "Output,Spread,Json", + "doc": "this is a model with a client name", "decorators": [], "serializationOptions": { "json": { - "name": "RoundTripModel" + "name": "ModelWithClientName" } }, "isExactName": false, "properties": [ { - "$id": "330", + "$id": "437", "kind": "property", - "name": "requiredString", + "name": "otherName", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredString", - "doc": "Required string, illustrating a reference type property.", + "serializedName": "otherName", + "doc": "name of the ModelWithClientName", "type": { - "$id": "331", + "$id": "438", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3587,31 +5068,73 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredString", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithClientName.otherName", "serializationOptions": { "json": { - "name": "requiredString" + "name": "otherName" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "439", + "kind": "model", + "name": "ReturnsAnonymousModelResponse", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [] + }, + { + "$id": "440", + "kind": "model", + "name": "ListWithNextLinkResponse", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [ { - "$id": "332", + "$id": "441", "kind": "property", - "name": "requiredInt", + "name": "things", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredInt", - "doc": "Required int, illustrating a value type property.", + "serializedName": "things", "type": { - "$id": "333", - "kind": "int32", - "name": "int32", - "encode": "string", - "crossLanguageDefinitionId": "TypeSpec.int32", + "$id": "442", + "kind": "array", + "name": "ArrayThing", + "valueType": { + "$ref": "342" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, @@ -3619,160 +5142,183 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredInt", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous.things", "serializationOptions": { "json": { - "name": "requiredInt" + "name": "things" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "334", + "$id": "443", "kind": "property", - "name": "requiredCollection", + "name": "next", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredCollection", - "doc": "Required collection of enums", + "serializedName": "next", "type": { - "$id": "335", - "kind": "array", - "name": "ArrayStringFixedEnum", - "valueType": { - "$ref": "17" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "444", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredCollection", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous.next", "serializationOptions": { "json": { - "name": "requiredCollection" + "name": "next" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "445", + "kind": "model", + "name": "ListWithStringNextLinkResponse", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [ { - "$id": "336", + "$id": "446", "kind": "property", - "name": "requiredDictionary", + "name": "things", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredDictionary", - "doc": "Required dictionary of enums", + "serializedName": "things", "type": { - "$id": "337", - "kind": "dict", - "keyType": { - "$id": "338", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "27" - }, - "decorators": [] + "$ref": "442" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredDictionary", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous.things", "serializationOptions": { "json": { - "name": "requiredDictionary" + "name": "things" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "339", + "$id": "447", "kind": "property", - "name": "requiredModel", + "name": "next", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredModel", - "doc": "Required model", + "serializedName": "next", "type": { - "$ref": "294" + "$id": "448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredModel", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous.next", "serializationOptions": { "json": { - "name": "requiredModel" + "name": "next" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "449", + "kind": "model", + "name": "ListWithContinuationTokenResponse", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [ { - "$id": "340", + "$id": "450", "kind": "property", - "name": "intExtensibleEnum", + "name": "things", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "intExtensibleEnum", - "doc": "this is an int based extensible enum", + "serializedName": "things", "type": { - "$ref": "37" + "$ref": "442" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intExtensibleEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous.things", "serializationOptions": { "json": { - "name": "intExtensibleEnum" + "name": "things" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "341", + "$id": "451", "kind": "property", - "name": "intExtensibleEnumCollection", + "name": "nextToken", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "intExtensibleEnumCollection", - "doc": "this is a collection of int based extensible enum", + "serializedName": "nextToken", "type": { - "$id": "342", - "kind": "array", - "name": "ArrayIntExtensibleEnum", - "valueType": { - "$ref": "37" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "452", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "optional": true, @@ -3780,642 +5326,624 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intExtensibleEnumCollection", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous.nextToken", "serializationOptions": { "json": { - "name": "intExtensibleEnumCollection" + "name": "nextToken" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "453", + "kind": "model", + "name": "ListWithContinuationTokenHeaderResponseResponse", + "apiVersions": [], + "namespace": "", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [ { - "$id": "343", + "$id": "454", "kind": "property", - "name": "floatExtensibleEnum", + "name": "things", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "floatExtensibleEnum", - "doc": "this is a float based extensible enum", + "serializedName": "things", "type": { - "$ref": "42" + "$ref": "442" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatExtensibleEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.Response.anonymous.things", "serializationOptions": { "json": { - "name": "floatExtensibleEnum" + "name": "things" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "455", + "kind": "model", + "name": "PageThing", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Page", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "Page" + } + }, + "isExactName": false, + "properties": [ { - "$id": "344", + "$id": "456", "kind": "property", - "name": "floatExtensibleEnumWithIntValue", + "name": "items", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "floatExtensibleEnumWithIntValue", - "doc": "this is a float based extensible enum", + "serializedName": "items", "type": { - "$ref": "47" + "$ref": "442" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatExtensibleEnumWithIntValue", + "crossLanguageDefinitionId": "SampleTypeSpec.Page.items", "serializationOptions": { "json": { - "name": "floatExtensibleEnumWithIntValue" + "name": "items" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "457", + "kind": "model", + "name": "ModelWithEmbeddedNonBodyParameters", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters", + "usage": "Input,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelWithEmbeddedNonBodyParameters" + } + }, + "isExactName": false, + "properties": [ { - "$id": "345", + "$id": "458", "kind": "property", - "name": "floatExtensibleEnumCollection", + "name": "name", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "floatExtensibleEnumCollection", - "doc": "this is a collection of float based extensible enum", + "serializedName": "name", + "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "346", - "kind": "array", - "name": "ArrayFloatExtensibleEnum", - "valueType": { - "$ref": "42" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "459", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatExtensibleEnumCollection", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.name", "serializationOptions": { "json": { - "name": "floatExtensibleEnumCollection" + "name": "name" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "347", + "$id": "460", "kind": "property", - "name": "floatFixedEnum", + "name": "requiredHeader", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "floatFixedEnum", - "doc": "this is a float based fixed enum", + "serializedName": "requiredHeader", + "doc": "required header parameter", "type": { - "$ref": "52" + "$id": "461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatFixedEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "serializationOptions": { "json": { - "name": "floatFixedEnum" + "name": "requiredHeader" } }, - "isHttpMetadata": false, + "isHttpMetadata": true, "isExactName": false }, { - "$id": "348", + "$id": "462", "kind": "property", - "name": "floatFixedEnumWithIntValue", + "name": "optionalHeader", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "floatFixedEnumWithIntValue", - "doc": "this is a float based fixed enum", + "serializedName": "optionalHeader", + "doc": "optional header parameter", "type": { - "$ref": "57" + "$id": "463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatFixedEnumWithIntValue", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "serializationOptions": { "json": { - "name": "floatFixedEnumWithIntValue" + "name": "optionalHeader" } }, - "isHttpMetadata": false, + "isHttpMetadata": true, "isExactName": false }, { - "$id": "349", + "$id": "464", "kind": "property", - "name": "floatFixedEnumCollection", + "name": "requiredQuery", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "floatFixedEnumCollection", - "doc": "this is a collection of float based fixed enum", + "serializedName": "requiredQuery", + "doc": "required query parameter", "type": { - "$id": "350", - "kind": "array", - "name": "ArrayFloatFixedEnum", - "valueType": { - "$ref": "52" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.floatFixedEnumCollection", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", "serializationOptions": { "json": { - "name": "floatFixedEnumCollection" + "name": "requiredQuery" } }, - "isHttpMetadata": false, + "isHttpMetadata": true, "isExactName": false }, { - "$id": "351", + "$id": "466", "kind": "property", - "name": "intFixedEnum", + "name": "optionalQuery", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "intFixedEnum", - "doc": "this is a int based fixed enum", + "serializedName": "optionalQuery", + "doc": "optional query parameter", "type": { - "$ref": "62" + "$id": "467", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intFixedEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", "serializationOptions": { "json": { - "name": "intFixedEnum" + "name": "optionalQuery" } }, - "isHttpMetadata": false, + "isHttpMetadata": true, "isExactName": false - }, + } + ] + }, + { + "$id": "468", + "kind": "model", + "name": "DynamicModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel", + "usage": "Input,Json", + "doc": "A sample dynamic model.", + "decorators": [ { - "$id": "352", + "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", + "arguments": {} + } + ], + "serializationOptions": { + "json": { + "name": "DynamicModel" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "469", "kind": "property", - "name": "intFixedEnumCollection", + "name": "name", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "intFixedEnumCollection", - "doc": "this is a collection of int based fixed enum", + "serializedName": "name", "type": { - "$id": "353", - "kind": "array", - "name": "ArrayIntFixedEnum", - "valueType": { - "$ref": "62" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.intFixedEnumCollection", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.name", "serializationOptions": { "json": { - "name": "intFixedEnumCollection" + "name": "name" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "354", + "$id": "471", "kind": "property", - "name": "stringFixedEnum", + "name": "optionalUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "stringFixedEnum", - "doc": "this is a string based fixed enum", + "serializedName": "optionalUnknown", "type": { - "$ref": "17" + "$id": "472", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.stringFixedEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalUnknown", "serializationOptions": { "json": { - "name": "stringFixedEnum" + "name": "optionalUnknown" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "355", + "$id": "473", "kind": "property", - "name": "requiredUnknown", + "name": "optionalInt", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredUnknown", - "doc": "required unknown", + "serializedName": "optionalInt", "type": { - "$id": "356", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", + "$id": "474", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalInt", "serializationOptions": { "json": { - "name": "requiredUnknown" + "name": "optionalInt" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "357", + "$id": "475", "kind": "property", - "name": "optionalUnknown", + "name": "optionalNullableList", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalUnknown", - "doc": "optional unknown", + "serializedName": "optionalNullableList", "type": { - "$id": "358", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] + "$id": "476", + "kind": "nullable", + "type": { + "$ref": "371" + }, + "namespace": "SampleTypeSpec" }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.optionalUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalNullableList", "serializationOptions": { "json": { - "name": "optionalUnknown" + "name": "optionalNullableList" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "359", + "$id": "477", "kind": "property", - "name": "requiredRecordUnknown", + "name": "requiredNullableList", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredRecordUnknown", - "doc": "required record of unknown", + "serializedName": "requiredNullableList", "type": { - "$id": "360", - "kind": "dict", - "keyType": { - "$id": "361", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "362", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] + "$id": "478", + "kind": "nullable", + "type": { + "$ref": "371" }, - "decorators": [] + "namespace": "SampleTypeSpec" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredRecordUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.requiredNullableList", "serializationOptions": { "json": { - "name": "requiredRecordUnknown" + "name": "requiredNullableList" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "363", + "$id": "479", "kind": "property", - "name": "optionalRecordUnknown", + "name": "optionalNullableDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalRecordUnknown", - "doc": "optional record of unknown", + "serializedName": "optionalNullableDictionary", "type": { - "$ref": "360" + "$id": "480", + "kind": "nullable", + "type": { + "$id": "481", + "kind": "dict", + "keyType": { + "$id": "482", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "483", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.optionalRecordUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalNullableDictionary", "serializationOptions": { "json": { - "name": "optionalRecordUnknown" + "name": "optionalNullableDictionary" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "364", + "$id": "484", "kind": "property", - "name": "readOnlyRequiredRecordUnknown", + "name": "requiredNullableDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "readOnlyRequiredRecordUnknown", - "doc": "required readonly record of unknown", + "serializedName": "requiredNullableDictionary", "type": { - "$ref": "360" + "$id": "485", + "kind": "nullable", + "type": { + "$ref": "481" + }, + "namespace": "SampleTypeSpec" }, "optional": false, - "readOnly": true, + "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.readOnlyRequiredRecordUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.requiredNullableDictionary", "serializationOptions": { "json": { - "name": "readOnlyRequiredRecordUnknown" + "name": "requiredNullableDictionary" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "365", + "$id": "486", "kind": "property", - "name": "readOnlyOptionalRecordUnknown", + "name": "primitiveDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "readOnlyOptionalRecordUnknown", - "doc": "optional readonly record of unknown", + "serializedName": "primitiveDictionary", "type": { - "$ref": "360" + "$ref": "481" }, - "optional": true, - "readOnly": true, + "optional": false, + "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.readOnlyOptionalRecordUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.primitiveDictionary", "serializationOptions": { "json": { - "name": "readOnlyOptionalRecordUnknown" + "name": "primitiveDictionary" } }, "isHttpMetadata": false, "isExactName": false - }, - { - "$id": "366", - "kind": "property", - "name": "modelWithRequiredNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "modelWithRequiredNullable", - "doc": "this is a model with required nullable properties", - "type": { - "$id": "367", - "kind": "model", - "name": "ModelWithRequiredNullableProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties", - "usage": "Input,Output,Json", - "doc": "A model with a few required nullable properties", - "decorators": [], - "serializationOptions": { - "json": { - "name": "ModelWithRequiredNullableProperties" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "368", - "kind": "property", - "name": "requiredNullablePrimitive", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "requiredNullablePrimitive", - "doc": "required nullable primitive type", - "type": { - "$id": "369", - "kind": "nullable", - "type": { - "$id": "370", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.requiredNullablePrimitive", - "serializationOptions": { - "json": { - "name": "requiredNullablePrimitive" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "371", - "kind": "property", - "name": "requiredExtensibleEnum", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "requiredExtensibleEnum", - "doc": "required nullable extensible enum type", - "type": { - "$id": "372", - "kind": "nullable", - "type": { - "$ref": "27" - }, - "namespace": "SampleTypeSpec" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.requiredExtensibleEnum", - "serializationOptions": { - "json": { - "name": "requiredExtensibleEnum" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "373", - "kind": "property", - "name": "requiredFixedEnum", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "requiredFixedEnum", - "doc": "required nullable fixed enum type", - "type": { - "$id": "374", - "kind": "nullable", - "type": { - "$ref": "17" - }, - "namespace": "SampleTypeSpec" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.requiredFixedEnum", - "serializationOptions": { - "json": { - "name": "requiredFixedEnum" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "375", - "kind": "property", - "name": "fixedUnion", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "fixedUnion", - "type": { - "$ref": "72" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.fixedUnion", - "serializationOptions": { - "json": { - "name": "fixedUnion" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, + }, + { + "$id": "487", + "kind": "property", + "name": "foo", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "foo", + "type": { + "$id": "488", + "kind": "model", + "name": "AnotherDynamicModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.AnotherDynamicModel", + "usage": "Input,Json", + "doc": "Another sample dynamic model.", + "decorators": [ + { + "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", + "arguments": {} + } + ], + "serializationOptions": { + "json": { + "name": "AnotherDynamicModel" + } + }, + "isExactName": false, + "properties": [ { - "$id": "376", + "$id": "489", "kind": "property", - "name": "numericEnum", + "name": "bar", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "numericEnum", + "serializedName": "bar", "type": { - "$ref": "62" + "$id": "490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithRequiredNullableProperties.numericEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.AnotherDynamicModel.bar", "serializationOptions": { "json": { - "name": "numericEnum" + "name": "bar" } }, "isHttpMetadata": false, @@ -4428,31 +5956,32 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.modelWithRequiredNullable", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.foo", "serializationOptions": { "json": { - "name": "modelWithRequiredNullable" + "name": "foo" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "377", + "$id": "491", "kind": "property", - "name": "requiredBytes", + "name": "listFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredBytes", - "doc": "Required bytes", + "serializedName": "listFoo", "type": { - "$id": "378", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", + "$id": "492", + "kind": "array", + "name": "ArrayAnotherDynamicModel", + "valueType": { + "$ref": "488" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, @@ -4460,49 +5989,32 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.RoundTripModel.requiredBytes", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.listFoo", "serializationOptions": { "json": { - "name": "requiredBytes" + "name": "listFoo" } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$ref": "367" - }, - { - "$id": "379", - "kind": "model", - "name": "Wrapper", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper", - "usage": "Input", - "decorators": [], - "serializationOptions": {}, - "isExactName": false, - "properties": [ + }, { - "$id": "380", + "$id": "493", "kind": "property", - "name": "p1", + "name": "listOfListFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "header parameter", + "serializedName": "listOfListFoo", "type": { - "$id": "381", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "494", + "kind": "array", + "name": "ArrayArray", + "valueType": { + "$ref": "492" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, @@ -4510,47 +6022,113 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p1", - "serializationOptions": {}, - "isHttpMetadata": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.listOfListFoo", + "serializationOptions": { + "json": { + "name": "listOfListFoo" + } + }, + "isHttpMetadata": false, "isExactName": false }, { - "$id": "382", + "$id": "495", "kind": "property", - "name": "action", + "name": "dictionaryFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "body parameter", + "serializedName": "dictionaryFoo", + "type": { + "$id": "496", + "kind": "dict", + "keyType": { + "$id": "497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "488" + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.dictionaryFoo", + "serializationOptions": { + "json": { + "name": "dictionaryFoo" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "498", + "kind": "property", + "name": "dictionaryOfDictionaryFoo", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$ref": "329" + "$id": "499", + "kind": "dict", + "keyType": { + "$id": "500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "496" + }, + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.action", - "serializationOptions": {}, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.dictionaryOfDictionaryFoo", + "serializationOptions": { + "json": { + "name": "dictionaryOfDictionaryFoo" + } + }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "383", + "$id": "501", "kind": "property", - "name": "p2", + "name": "dictionaryListFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "path parameter", + "serializedName": "dictionaryListFoo", "type": { - "$id": "384", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "502", + "kind": "dict", + "keyType": { + "$id": "503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "492" + }, "decorators": [] }, "optional": false, @@ -4558,48 +6136,32 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p2", - "serializationOptions": {}, - "isHttpMetadata": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.dictionaryListFoo", + "serializationOptions": { + "json": { + "name": "dictionaryListFoo" + } + }, + "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "385", - "kind": "model", - "name": "Friend", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.NotFriend", - "usage": "Output,Spread,Json", - "doc": "this is not a friendly model but with a friendly name", - "decorators": [], - "serializationOptions": { - "json": { - "name": "NotFriend" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "386", + "$id": "504", "kind": "property", - "name": "name", + "name": "listOfDictionaryFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "name", - "doc": "name of the NotFriend", + "serializedName": "listOfDictionaryFoo", "type": { - "$id": "387", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "505", + "kind": "array", + "name": "ArrayRecord", + "valueType": { + "$ref": "496" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, @@ -4607,10 +6169,10 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NotFriend.name", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.listOfDictionaryFoo", "serializationOptions": { "json": { - "name": "name" + "name": "listOfDictionaryFoo" } }, "isHttpMetadata": false, @@ -4619,37 +6181,49 @@ ] }, { - "$id": "388", + "$ref": "488" + }, + { + "$id": "506", "kind": "model", - "name": "RenamedModel", + "name": "XmlAdvancedModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithClientName", - "usage": "Output,Spread,Json", - "doc": "this is a model with a client name", - "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel", + "usage": "Input,Output,Xml", + "doc": "An advanced XML model for testing various property types and XML features.", + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "AdvancedXmlModel" + } + } + ], "serializationOptions": { - "json": { - "name": "ModelWithClientName" + "xml": { + "name": "AdvancedXmlModel", + "attribute": false, + "unwrapped": false } }, "isExactName": false, "properties": [ { - "$id": "389", + "$id": "507", "kind": "property", - "name": "otherName", + "name": "name", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "otherName", - "doc": "name of the ModelWithClientName", + "serializedName": "name", + "doc": "A simple string property", "type": { - "$id": "390", + "$id": "508", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4660,73 +6234,32 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithClientName.otherName", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.name", "serializationOptions": { - "json": { - "name": "otherName" + "xml": { + "name": "name", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "391", - "kind": "model", - "name": "ReturnsAnonymousModelResponse", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [] - }, - { - "$id": "392", - "kind": "model", - "name": "ListWithNextLinkResponse", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "393", + "$id": "509", "kind": "property", - "name": "things", + "name": "age", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "things", + "serializedName": "age", + "doc": "An integer property", "type": { - "$id": "394", - "kind": "array", - "name": "ArrayThing", - "valueType": { - "$ref": "294" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "510", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, "optional": false, @@ -4734,103 +6267,95 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous.things", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.age", "serializationOptions": { - "json": { - "name": "things" + "xml": { + "name": "age", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "395", + "$id": "511", "kind": "property", - "name": "next", + "name": "enabled", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "next", + "serializedName": "enabled", + "doc": "A boolean property", "type": { - "$id": "396", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", + "$id": "512", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous.next", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.enabled", "serializationOptions": { - "json": { - "name": "next" + "xml": { + "name": "enabled", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "397", - "kind": "model", - "name": "ListWithStringNextLinkResponse", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "398", + "$id": "513", "kind": "property", - "name": "things", + "name": "score", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "things", + "serializedName": "score", + "doc": "A float property", "type": { - "$ref": "394" + "$id": "514", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous.things", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.score", "serializationOptions": { - "json": { - "name": "things" + "xml": { + "name": "score", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "399", + "$id": "515", "kind": "property", - "name": "next", + "name": "optionalString", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "next", + "serializedName": "optionalString", + "doc": "An optional string", "type": { - "$id": "400", + "$id": "516", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4841,247 +6366,214 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous.next", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalString", "serializationOptions": { - "json": { - "name": "next" + "xml": { + "name": "optionalString", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "401", - "kind": "model", - "name": "ListWithContinuationTokenResponse", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "402", + "$id": "517", "kind": "property", - "name": "things", + "name": "optionalInt", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "things", + "serializedName": "optionalInt", + "doc": "An optional integer", "type": { - "$ref": "394" + "$id": "518", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous.things", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalInt", "serializationOptions": { - "json": { - "name": "things" + "xml": { + "name": "optionalInt", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "403", + "$id": "519", "kind": "property", - "name": "nextToken", + "name": "nullableString", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nextToken", + "serializedName": "nullableString", + "doc": "A nullable string", "type": { - "$id": "404", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$id": "520", + "kind": "nullable", + "type": { + "$id": "521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous.nextToken", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.nullableString", "serializationOptions": { - "json": { - "name": "nextToken" + "xml": { + "name": "nullableString", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "405", - "kind": "model", - "name": "ListWithContinuationTokenHeaderResponseResponse", - "apiVersions": [], - "namespace": "", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [ + "isExactName": false + }, { - "$id": "406", + "$id": "522", "kind": "property", - "name": "things", + "name": "id", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "things", + "serializedName": "id", + "doc": "A string as XML attribute", "type": { - "$ref": "394" + "$id": "523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.Response.anonymous.things", + "decorators": [ + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.id", "serializationOptions": { - "json": { - "name": "things" + "xml": { + "name": "id", + "attribute": true, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "407", - "kind": "model", - "name": "PageThing", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Page", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "Page" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "408", + "$id": "524", "kind": "property", - "name": "items", + "name": "version", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "items", + "serializedName": "version", + "doc": "An integer as XML attribute", "type": { - "$ref": "394" + "$id": "525", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Page.items", + "decorators": [ + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.version", "serializationOptions": { - "json": { - "name": "items" + "xml": { + "name": "version", + "attribute": true, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "409", - "kind": "model", - "name": "ModelWithEmbeddedNonBodyParameters", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters", - "usage": "Input,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "ModelWithEmbeddedNonBodyParameters" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "410", + "$id": "526", "kind": "property", - "name": "name", + "name": "isActive", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "name", - "doc": "name of the ModelWithEmbeddedNonBodyParameters", + "serializedName": "isActive", + "doc": "A boolean as XML attribute", "type": { - "$id": "411", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "527", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.name", + "decorators": [ + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.isActive", "serializationOptions": { - "json": { - "name": "name" + "xml": { + "name": "isActive", + "attribute": true, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "412", + "$id": "528", "kind": "property", - "name": "requiredHeader", + "name": "originalName", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredHeader", - "doc": "required header parameter", + "serializedName": "RenamedProperty", + "doc": "A property with a custom XML element name", "type": { - "$id": "413", + "$id": "529", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5091,59 +6583,81 @@ "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "RenamedProperty" + } + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.originalName", "serializationOptions": { - "json": { - "name": "requiredHeader" + "xml": { + "name": "RenamedProperty", + "attribute": false, + "unwrapped": false } }, - "isHttpMetadata": true, + "isHttpMetadata": false, "isExactName": false }, { - "$id": "414", + "$id": "530", "kind": "property", - "name": "optionalHeader", + "name": "xmlIdentifier", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalHeader", - "doc": "optional header parameter", + "serializedName": "xml-id", + "doc": "An attribute with a custom XML name", "type": { - "$id": "415", + "$id": "531", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "xml-id" + } + }, + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.xmlIdentifier", "serializationOptions": { - "json": { - "name": "optionalHeader" + "xml": { + "name": "xml-id", + "attribute": true, + "unwrapped": false } }, - "isHttpMetadata": true, + "isHttpMetadata": false, "isExactName": false }, { - "$id": "416", + "$id": "532", "kind": "property", - "name": "requiredQuery", + "name": "content", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredQuery", - "doc": "required query parameter", + "serializedName": "content", + "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "417", + "$id": "533", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5153,427 +6667,627 @@ "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", + "decorators": [ + { + "name": "TypeSpec.Xml.@unwrapped", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.content", "serializationOptions": { - "json": { - "name": "requiredQuery" + "xml": { + "name": "content", + "attribute": false, + "unwrapped": true } }, - "isHttpMetadata": true, + "isHttpMetadata": false, "isExactName": false }, { - "$id": "418", + "$id": "534", "kind": "property", - "name": "optionalQuery", + "name": "unwrappedStrings", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalQuery", - "doc": "optional query parameter", + "serializedName": "unwrappedStrings", + "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$id": "419", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "348" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", - "serializationOptions": { - "json": { - "name": "optionalQuery" - } - }, - "isHttpMetadata": true, - "isExactName": false - } - ] - }, - { - "$id": "420", - "kind": "model", - "name": "DynamicModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel", - "usage": "Input,Json", - "doc": "A sample dynamic model.", - "decorators": [ - { - "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", - "arguments": {} - } - ], - "serializationOptions": { - "json": { - "name": "DynamicModel" - } - }, - "isExactName": false, - "properties": [ + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@unwrapped", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedStrings", + "serializationOptions": { + "xml": { + "name": "unwrappedStrings", + "attribute": false, + "unwrapped": true, + "itemsName": "unwrappedStrings" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, { - "$id": "421", + "$id": "535", "kind": "property", - "name": "name", + "name": "unwrappedCounts", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "name", + "serializedName": "unwrappedCounts", + "doc": "An unwrapped array of integers", "type": { - "$id": "422", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "371" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.name", + "decorators": [ + { + "name": "TypeSpec.Xml.@unwrapped", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedCounts", "serializationOptions": { - "json": { - "name": "name" + "xml": { + "name": "unwrappedCounts", + "attribute": false, + "unwrapped": true, + "itemsName": "unwrappedCounts" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "423", + "$id": "536", "kind": "property", - "name": "optionalUnknown", + "name": "unwrappedItems", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalUnknown", + "serializedName": "unwrappedItems", + "doc": "An unwrapped array of models", "type": { - "$id": "424", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", + "$id": "537", + "kind": "array", + "name": "ArrayXmlItem", + "valueType": { + "$id": "538", + "kind": "model", + "name": "XmlItem", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem", + "usage": "Input,Output,Xml", + "doc": "An item model for XML array testing", + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "Item" + } + } + ], + "serializationOptions": { + "xml": { + "name": "Item", + "attribute": false, + "unwrapped": false + } + }, + "isExactName": false, + "properties": [ + { + "$id": "539", + "kind": "property", + "name": "itemName", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "itemName", + "doc": "The item name", + "type": { + "$id": "540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem.itemName", + "serializationOptions": { + "xml": { + "name": "itemName", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "541", + "kind": "property", + "name": "itemValue", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "itemValue", + "doc": "The item value", + "type": { + "$id": "542", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem.itemValue", + "serializationOptions": { + "xml": { + "name": "itemValue", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "543", + "kind": "property", + "name": "itemId", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "itemId", + "doc": "Item ID as attribute", + "type": { + "$id": "544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem.itemId", + "serializationOptions": { + "xml": { + "name": "itemId", + "attribute": true, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalUnknown", + "decorators": [ + { + "name": "TypeSpec.Xml.@unwrapped", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedItems", "serializationOptions": { - "json": { - "name": "optionalUnknown" + "xml": { + "name": "unwrappedItems", + "attribute": false, + "unwrapped": true, + "itemsName": "unwrappedItems" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "425", + "$id": "545", "kind": "property", - "name": "optionalInt", + "name": "wrappedColors", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalInt", + "serializedName": "wrappedColors", + "doc": "A wrapped array of strings (default)", "type": { - "$id": "426", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] + "$ref": "348" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalInt", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.wrappedColors", "serializationOptions": { - "json": { - "name": "optionalInt" + "xml": { + "name": "wrappedColors", + "attribute": false, + "unwrapped": false, + "itemsName": "string" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "427", + "$id": "546", "kind": "property", - "name": "optionalNullableList", + "name": "items", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalNullableList", + "serializedName": "ItemCollection", + "doc": "A wrapped array with custom wrapper name", "type": { - "$id": "428", - "kind": "nullable", - "type": { - "$ref": "323" - }, - "namespace": "SampleTypeSpec" + "$ref": "537" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalNullableList", + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "ItemCollection" + } + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.items", "serializationOptions": { - "json": { - "name": "optionalNullableList" + "xml": { + "name": "ItemCollection", + "attribute": false, + "unwrapped": false, + "itemsName": "Item" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "429", + "$id": "547", "kind": "property", - "name": "requiredNullableList", + "name": "nestedModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredNullableList", + "serializedName": "nestedModel", + "doc": "A nested model property", "type": { - "$id": "430", - "kind": "nullable", - "type": { - "$ref": "323" + "$id": "548", + "kind": "model", + "name": "XmlNestedModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNestedModel", + "usage": "Input,Output,Xml", + "doc": "A nested model for XML testing", + "decorators": [], + "serializationOptions": { + "xml": { + "name": "XmlNestedModel", + "attribute": false, + "unwrapped": false + } }, - "namespace": "SampleTypeSpec" + "isExactName": false, + "properties": [ + { + "$id": "549", + "kind": "property", + "name": "value", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "value", + "doc": "The value of the nested model", + "type": { + "$id": "550", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNestedModel.value", + "serializationOptions": { + "xml": { + "name": "value", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "551", + "kind": "property", + "name": "nestedId", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nestedId", + "doc": "An attribute on the nested model", + "type": { + "$id": "552", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNestedModel.nestedId", + "serializationOptions": { + "xml": { + "name": "nestedId", + "attribute": true, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.requiredNullableList", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.nestedModel", "serializationOptions": { - "json": { - "name": "requiredNullableList" + "xml": { + "name": "nestedModel", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "431", + "$id": "553", "kind": "property", - "name": "optionalNullableDictionary", + "name": "optionalNestedModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalNullableDictionary", + "serializedName": "optionalNestedModel", + "doc": "An optional nested model", "type": { - "$id": "432", - "kind": "nullable", - "type": { - "$id": "433", - "kind": "dict", - "keyType": { - "$id": "434", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "435", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" + "$ref": "548" }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.optionalNullableDictionary", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalNestedModel", "serializationOptions": { - "json": { - "name": "optionalNullableDictionary" + "xml": { + "name": "optionalNestedModel", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "436", + "$id": "554", "kind": "property", - "name": "requiredNullableDictionary", + "name": "metadata", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "requiredNullableDictionary", + "serializedName": "metadata", + "doc": "A dictionary property", "type": { - "$id": "437", - "kind": "nullable", - "type": { - "$ref": "433" + "$id": "555", + "kind": "dict", + "keyType": { + "$id": "556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "namespace": "SampleTypeSpec" + "valueType": { + "$id": "557", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.requiredNullableDictionary", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.metadata", "serializationOptions": { - "json": { - "name": "requiredNullableDictionary" + "xml": { + "name": "metadata", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "438", + "$id": "558", "kind": "property", - "name": "primitiveDictionary", + "name": "createdAt", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "primitiveDictionary", + "serializedName": "createdAt", + "doc": "A date-time property", "type": { - "$ref": "433" + "$id": "559", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.primitiveDictionary", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.createdAt", "serializationOptions": { - "json": { - "name": "primitiveDictionary" + "xml": { + "name": "createdAt", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "439", + "$id": "561", "kind": "property", - "name": "foo", + "name": "duration", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "foo", + "serializedName": "duration", + "doc": "A duration property", "type": { - "$id": "440", - "kind": "model", - "name": "AnotherDynamicModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.AnotherDynamicModel", - "usage": "Input,Json", - "doc": "Another sample dynamic model.", - "decorators": [ - { - "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", - "arguments": {} - } - ], - "serializationOptions": { - "json": { - "name": "AnotherDynamicModel" - } + "$id": "562", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "isExactName": false, - "properties": [ - { - "$id": "441", - "kind": "property", - "name": "bar", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "bar", - "type": { - "$id": "442", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnotherDynamicModel.bar", - "serializationOptions": { - "json": { - "name": "bar" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.foo", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.duration", "serializationOptions": { - "json": { - "name": "foo" + "xml": { + "name": "duration", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "443", + "$id": "564", "kind": "property", - "name": "listFoo", + "name": "data", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listFoo", + "serializedName": "data", + "doc": "A bytes property", "type": { - "$id": "444", - "kind": "array", - "name": "ArrayAnotherDynamicModel", - "valueType": { - "$ref": "440" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "565", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", "decorators": [] }, "optional": false, @@ -5581,256 +7295,336 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.listFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.data", "serializationOptions": { - "json": { - "name": "listFoo" + "xml": { + "name": "data", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "445", + "$id": "566", "kind": "property", - "name": "listOfListFoo", + "name": "optionalRecordUnknown", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listOfListFoo", + "serializedName": "optionalRecordUnknown", + "doc": "optional record of unknown", "type": { - "$id": "446", - "kind": "array", - "name": "ArrayArray", - "valueType": { - "$ref": "444" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "$ref": "408" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.listOfListFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalRecordUnknown", "serializationOptions": { - "json": { - "name": "listOfListFoo" + "xml": { + "name": "optionalRecordUnknown", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "447", + "$id": "567", "kind": "property", - "name": "dictionaryFoo", + "name": "fixedEnum", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "dictionaryFoo", + "serializedName": "fixedEnum", + "doc": "A fixed enum property", "type": { - "$id": "448", - "kind": "dict", - "keyType": { - "$id": "449", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "440" - }, - "decorators": [] + "$ref": "17" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.dictionaryFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.fixedEnum", "serializationOptions": { - "json": { - "name": "dictionaryFoo" + "xml": { + "name": "fixedEnum", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "450", + "$id": "568", "kind": "property", - "name": "dictionaryOfDictionaryFoo", + "name": "extensibleEnum", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "dictionaryOfDictionaryFoo", + "serializedName": "extensibleEnum", + "doc": "An extensible enum property", "type": { - "$id": "451", - "kind": "dict", - "keyType": { - "$id": "452", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "448" - }, - "decorators": [] + "$ref": "27" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.dictionaryOfDictionaryFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.extensibleEnum", "serializationOptions": { - "json": { - "name": "dictionaryOfDictionaryFoo" + "xml": { + "name": "extensibleEnum", + "attribute": false, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "453", + "$id": "569", "kind": "property", - "name": "dictionaryListFoo", + "name": "optionalFixedEnum", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "dictionaryListFoo", + "serializedName": "optionalFixedEnum", + "doc": "An optional fixed enum property", "type": { - "$id": "454", - "kind": "dict", - "keyType": { - "$id": "455", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "444" + "$ref": "62" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalFixedEnum", + "serializationOptions": { + "xml": { + "name": "optionalFixedEnum", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "570", + "kind": "property", + "name": "optionalExtensibleEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalExtensibleEnum", + "doc": "An optional extensible enum property", + "type": { + "$ref": "37" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalExtensibleEnum", + "serializationOptions": { + "xml": { + "name": "optionalExtensibleEnum", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "571", + "kind": "property", + "name": "label", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "label", + "type": { + "$id": "572", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@ns", + "arguments": { + "ns": { + "$id": "573", + "kind": "enumvalue", + "decorators": [], + "name": "ns1", + "isExactName": false, + "value": "https://example.com/ns1", + "enumType": { + "$id": "574", + "kind": "enum", + "decorators": [ + { + "name": "TypeSpec.Xml.@nsDeclarations", + "arguments": {} + } + ], + "name": "XmlNamespaces", + "isGeneratedName": false, + "isExactName": false, + "namespace": "SampleTypeSpec", + "valueType": { + "$id": "575", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "values": [ + { + "$id": "576", + "kind": "enumvalue", + "decorators": [], + "name": "ns1", + "isExactName": false, + "value": "https://example.com/ns1", + "enumType": { + "$ref": "574" + }, + "valueType": { + "$ref": "575" + }, + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" + }, + { + "$id": "577", + "kind": "enumvalue", + "decorators": [], + "name": "ns2", + "isExactName": false, + "value": "https://example.com/ns2", + "enumType": { + "$ref": "574" + }, + "valueType": { + "$ref": "575" + }, + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "access": "public", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "isUnionAsEnum": false, + "__accessSet": true + }, + "valueType": { + "$ref": "575" + }, + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" + } + } }, - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.dictionaryListFoo", + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.label", "serializationOptions": { - "json": { - "name": "dictionaryListFoo" + "xml": { + "name": "label", + "attribute": true, + "ns": { + "namespace": "https://example.com/ns1", + "prefix": "ns1" + }, + "unwrapped": false } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "456", + "$id": "578", "kind": "property", - "name": "listOfDictionaryFoo", + "name": "daysUsed", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listOfDictionaryFoo", + "serializedName": "daysUsed", "type": { - "$id": "457", - "kind": "array", - "name": "ArrayRecord", - "valueType": { - "$ref": "448" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "579", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModel.listOfDictionaryFoo", - "serializationOptions": { - "json": { - "name": "listOfDictionaryFoo" + "decorators": [ + { + "name": "TypeSpec.Xml.@ns", + "arguments": { + "ns": { + "$id": "580", + "kind": "enumvalue", + "decorators": [], + "name": "ns2", + "isExactName": false, + "value": "https://example.com/ns2", + "enumType": { + "$ref": "574" + }, + "valueType": { + "$ref": "575" + }, + "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" + } + } } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$ref": "440" - }, - { - "$id": "458", - "kind": "model", - "name": "XmlAdvancedModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel", - "usage": "Input,Output,Xml", - "doc": "An advanced XML model for testing various property types and XML features.", - "decorators": [ - { - "name": "TypeSpec.Xml.@name", - "arguments": { - "name": "AdvancedXmlModel" - } - } - ], - "serializationOptions": { - "xml": { - "name": "AdvancedXmlModel", - "attribute": false, - "unwrapped": false - } - }, - "isExactName": false, - "properties": [ - { - "$id": "459", - "kind": "property", - "name": "name", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" ], - "serializedName": "name", - "doc": "A simple string property", - "type": { - "$id": "460", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.name", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.daysUsed", "serializationOptions": { "xml": { - "name": "name", + "name": "daysUsed", "attribute": false, + "ns": { + "namespace": "https://example.com/ns2", + "prefix": "ns2" + }, "unwrapped": false } }, @@ -5838,65 +7632,80 @@ "isExactName": false }, { - "$id": "461", + "$id": "581", "kind": "property", - "name": "age", + "name": "fooItems", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "age", - "doc": "An integer property", + "serializedName": "fooItems", "type": { - "$id": "462", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] + "$ref": "348" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.age", + "decorators": [ + { + "name": "TypeSpec.Xml.@ns", + "arguments": { + "ns": "http://www.contoso.com/anotherbook.dtd", + "prefix": "foo" + } + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.fooItems", "serializationOptions": { "xml": { - "name": "age", + "name": "fooItems", "attribute": false, - "unwrapped": false + "ns": { + "namespace": "http://www.contoso.com/anotherbook.dtd", + "prefix": "foo" + }, + "unwrapped": false, + "itemsName": "string" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "463", + "$id": "582", "kind": "property", - "name": "enabled", + "name": "anotherModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "enabled", - "doc": "A boolean property", + "serializedName": "anotherModel", "type": { - "$id": "464", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] + "$ref": "548" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.enabled", + "decorators": [ + { + "name": "TypeSpec.Xml.@ns", + "arguments": { + "ns": "http://www.contoso.com/anothermodel.dtd", + "prefix": "bar" + } + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.anotherModel", "serializationOptions": { "xml": { - "name": "enabled", + "name": "anotherModel", "attribute": false, + "ns": { + "namespace": "http://www.contoso.com/anothermodel.dtd", + "prefix": "bar" + }, "unwrapped": false } }, @@ -5904,20 +7713,86 @@ "isExactName": false }, { - "$id": "465", + "$id": "583", "kind": "property", - "name": "score", + "name": "modelsWithNamespaces", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "score", - "doc": "A float property", + "serializedName": "modelsWithNamespaces", "type": { - "$id": "466", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", + "$id": "584", + "kind": "array", + "name": "ArrayXmlModelWithNamespace", + "valueType": { + "$id": "585", + "kind": "model", + "name": "XmlModelWithNamespace", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlModelWithNamespace", + "usage": "Input,Output,Xml", + "decorators": [ + { + "name": "TypeSpec.Xml.@ns", + "arguments": { + "ns": "http://www.example.com/namespace", + "prefix": "ns1" + } + } + ], + "serializationOptions": { + "xml": { + "name": "XmlModelWithNamespace", + "attribute": false, + "ns": { + "namespace": "http://www.example.com/namespace", + "prefix": "ns1" + }, + "unwrapped": false + } + }, + "isExactName": false, + "properties": [ + { + "$id": "586", + "kind": "property", + "name": "foo", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "foo", + "type": { + "$id": "587", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlModelWithNamespace.foo", + "serializationOptions": { + "xml": { + "name": "foo", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, @@ -5925,114 +7800,125 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.score", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.modelsWithNamespaces", "serializationOptions": { "xml": { - "name": "score", + "name": "modelsWithNamespaces", "attribute": false, - "unwrapped": false + "unwrapped": false, + "itemsName": "XmlModelWithNamespace", + "itemsNs": { + "namespace": "http://www.example.com/namespace", + "prefix": "ns1" + } } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "467", + "$id": "588", "kind": "property", - "name": "optionalString", + "name": "unwrappedModelsWithNamespaces", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalString", - "doc": "An optional string", + "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$id": "468", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "584" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalString", + "decorators": [ + { + "name": "TypeSpec.Xml.@unwrapped", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedModelsWithNamespaces", "serializationOptions": { "xml": { - "name": "optionalString", + "name": "unwrappedModelsWithNamespaces", "attribute": false, - "unwrapped": false + "unwrapped": true, + "itemsName": "unwrappedModelsWithNamespaces" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "469", + "$id": "589", "kind": "property", - "name": "optionalInt", + "name": "listOfListFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalInt", - "doc": "An optional integer", + "serializedName": "listOfListFoo", "type": { - "$id": "470", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", + "$id": "590", + "kind": "array", + "name": "ArrayArray1", + "valueType": { + "$ref": "537" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalInt", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.listOfListFoo", "serializationOptions": { "xml": { - "name": "optionalInt", + "name": "listOfListFoo", "attribute": false, - "unwrapped": false + "unwrapped": false, + "itemsName": "Array" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "471", + "$id": "591", "kind": "property", - "name": "nullableString", + "name": "dictionaryFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nullableString", - "doc": "A nullable string", + "serializedName": "dictionaryFoo", "type": { - "$id": "472", - "kind": "nullable", - "type": { - "$id": "473", + "$id": "592", + "kind": "dict", + "keyType": { + "$id": "593", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "namespace": "SampleTypeSpec" + "valueType": { + "$ref": "538" + }, + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.nullableString", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.dictionaryFoo", "serializationOptions": { "xml": { - "name": "nullableString", + "name": "dictionaryFoo", "attribute": false, "unwrapped": false } @@ -6041,37 +7927,39 @@ "isExactName": false }, { - "$id": "474", + "$id": "594", "kind": "property", - "name": "id", + "name": "dictionaryOfDictionaryFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "id", - "doc": "A string as XML attribute", + "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "475", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "595", + "kind": "dict", + "keyType": { + "$id": "596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "592" + }, "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.id", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.dictionaryOfDictionaryFoo", "serializationOptions": { "xml": { - "name": "id", - "attribute": true, + "name": "dictionaryOfDictionaryFoo", + "attribute": false, "unwrapped": false } }, @@ -6079,37 +7967,39 @@ "isExactName": false }, { - "$id": "476", + "$id": "597", "kind": "property", - "name": "version", + "name": "dictionaryListFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "version", - "doc": "An integer as XML attribute", + "serializedName": "dictionaryListFoo", "type": { - "$id": "477", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", + "$id": "598", + "kind": "dict", + "keyType": { + "$id": "599", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "537" + }, "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.version", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.dictionaryListFoo", "serializationOptions": { "xml": { - "name": "version", - "attribute": true, + "name": "dictionaryListFoo", + "attribute": false, "unwrapped": false } }, @@ -6117,55 +8007,78 @@ "isExactName": false }, { - "$id": "478", + "$id": "600", "kind": "property", - "name": "isActive", + "name": "listOfDictionaryFoo", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "isActive", - "doc": "A boolean as XML attribute", + "serializedName": "listOfDictionaryFoo", "type": { - "$id": "479", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", + "$id": "601", + "kind": "array", + "name": "ArrayRecord1", + "valueType": { + "$ref": "592" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.isActive", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.listOfDictionaryFoo", "serializationOptions": { "xml": { - "name": "isActive", - "attribute": true, - "unwrapped": false + "name": "listOfDictionaryFoo", + "attribute": false, + "unwrapped": false, + "itemsName": "Record" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$ref": "538" + }, + { + "$ref": "548" + }, + { + "$ref": "585" + }, + { + "$id": "602", + "kind": "model", + "name": "Cat", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat", + "usage": "Input,MultipartFormData", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, + "properties": [ { - "$id": "480", + "$id": "603", "kind": "property", - "name": "originalName", + "name": "id", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "RenamedProperty", - "doc": "A property with a custom XML element name", + "serializedName": "id", "type": { - "$id": "481", + "$id": "604", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6175,594 +8088,363 @@ "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@name", - "arguments": { - "name": "RenamedProperty" - } - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.originalName", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.id", "serializationOptions": { - "xml": { - "name": "RenamedProperty", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "id", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "482", + "$id": "605", "kind": "property", - "name": "xmlIdentifier", + "name": "boolPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "xml-id", - "doc": "An attribute with a custom XML name", + "serializedName": "boolPart", "type": { - "$id": "483", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "606", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", "decorators": [] }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@name", - "arguments": { - "name": "xml-id" - } - }, - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.xmlIdentifier", + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.boolPart", "serializationOptions": { - "xml": { - "name": "xml-id", - "attribute": true, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "boolPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "484", + "$id": "607", "kind": "property", - "name": "content", + "name": "int32Part", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "content", - "doc": "Text content in the element (unwrapped string)", + "serializedName": "int32Part", "type": { - "$id": "485", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "608", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@unwrapped", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.content", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.int32Part", "serializationOptions": { - "xml": { - "name": "content", - "attribute": false, - "unwrapped": true + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "int32Part", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "486", + "$id": "609", "kind": "property", - "name": "unwrappedStrings", + "name": "int64Part", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "unwrappedStrings", - "doc": "An unwrapped array of strings - items appear directly without wrapper", + "serializedName": "int64Part", "type": { - "$ref": "300" + "$id": "610", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@unwrapped", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedStrings", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.int64Part", "serializationOptions": { - "xml": { - "name": "unwrappedStrings", - "attribute": false, - "unwrapped": true, - "itemsName": "unwrappedStrings" + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "int64Part", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "487", + "$id": "611", "kind": "property", - "name": "unwrappedCounts", + "name": "float32Part", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "unwrappedCounts", - "doc": "An unwrapped array of integers", + "serializedName": "float32Part", "type": { - "$ref": "323" + "$id": "612", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@unwrapped", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedCounts", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.float32Part", "serializationOptions": { - "xml": { - "name": "unwrappedCounts", - "attribute": false, - "unwrapped": true, - "itemsName": "unwrappedCounts" + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "float32Part", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "488", + "$id": "613", "kind": "property", - "name": "unwrappedItems", + "name": "float64Part", "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "unwrappedItems", - "doc": "An unwrapped array of models", - "type": { - "$id": "489", - "kind": "array", - "name": "ArrayXmlItem", - "valueType": { - "$id": "490", - "kind": "model", - "name": "XmlItem", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem", - "usage": "Input,Output,Xml", - "doc": "An item model for XML array testing", - "decorators": [ - { - "name": "TypeSpec.Xml.@name", - "arguments": { - "name": "Item" - } - } - ], - "serializationOptions": { - "xml": { - "name": "Item", - "attribute": false, - "unwrapped": false - } - }, - "isExactName": false, - "properties": [ - { - "$id": "491", - "kind": "property", - "name": "itemName", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "itemName", - "doc": "The item name", - "type": { - "$id": "492", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem.itemName", - "serializationOptions": { - "xml": { - "name": "itemName", - "attribute": false, - "unwrapped": false - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "493", - "kind": "property", - "name": "itemValue", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "itemValue", - "doc": "The item value", - "type": { - "$id": "494", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem.itemValue", - "serializationOptions": { - "xml": { - "name": "itemValue", - "attribute": false, - "unwrapped": false - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "495", - "kind": "property", - "name": "itemId", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "itemId", - "doc": "Item ID as attribute", - "type": { - "$id": "496", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlItem.itemId", - "serializationOptions": { - "xml": { - "name": "itemId", - "attribute": true, - "unwrapped": false - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "float64Part", + "type": { + "$id": "614", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@unwrapped", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedItems", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.float64Part", "serializationOptions": { - "xml": { - "name": "unwrappedItems", - "attribute": false, - "unwrapped": true, - "itemsName": "unwrappedItems" + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "float64Part", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "497", + "$id": "615", "kind": "property", - "name": "wrappedColors", + "name": "decimalPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "wrappedColors", - "doc": "A wrapped array of strings (default)", + "serializedName": "decimalPart", "type": { - "$ref": "300" + "$id": "616", + "kind": "decimal128", + "name": "decimal128", + "crossLanguageDefinitionId": "TypeSpec.decimal128", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.wrappedColors", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.decimalPart", "serializationOptions": { - "xml": { - "name": "wrappedColors", - "attribute": false, - "unwrapped": false, - "itemsName": "string" + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "decimalPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "498", + "$id": "617", "kind": "property", - "name": "items", + "name": "int8Part", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "ItemCollection", - "doc": "A wrapped array with custom wrapper name", + "serializedName": "int8Part", "type": { - "$ref": "489" + "$id": "618", + "kind": "int8", + "name": "int8", + "crossLanguageDefinitionId": "TypeSpec.int8", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@name", - "arguments": { - "name": "ItemCollection" - } - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.items", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.int8Part", "serializationOptions": { - "xml": { - "name": "ItemCollection", - "attribute": false, - "unwrapped": false, - "itemsName": "Item" + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "int8Part", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "499", + "$id": "619", "kind": "property", - "name": "nestedModel", + "name": "uint8Part", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nestedModel", - "doc": "A nested model property", + "serializedName": "uint8Part", "type": { - "$id": "500", - "kind": "model", - "name": "XmlNestedModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNestedModel", - "usage": "Input,Output,Xml", - "doc": "A nested model for XML testing", - "decorators": [], - "serializationOptions": { - "xml": { - "name": "XmlNestedModel", - "attribute": false, - "unwrapped": false - } - }, - "isExactName": false, - "properties": [ - { - "$id": "501", - "kind": "property", - "name": "value", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "value", - "doc": "The value of the nested model", - "type": { - "$id": "502", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNestedModel.value", - "serializationOptions": { - "xml": { - "name": "value", - "attribute": false, - "unwrapped": false - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "503", - "kind": "property", - "name": "nestedId", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nestedId", - "doc": "An attribute on the nested model", - "type": { - "$id": "504", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNestedModel.nestedId", - "serializationOptions": { - "xml": { - "name": "nestedId", - "attribute": true, - "unwrapped": false - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] + "$id": "620", + "kind": "uint8", + "name": "uint8", + "crossLanguageDefinitionId": "TypeSpec.uint8", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.nestedModel", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.uint8Part", "serializationOptions": { - "xml": { - "name": "nestedModel", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "uint8Part", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "505", + "$id": "621", "kind": "property", - "name": "optionalNestedModel", + "name": "dictionaryPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalNestedModel", - "doc": "An optional nested model", + "serializedName": "dictionaryPart", "type": { - "$ref": "500" + "$ref": "555" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalNestedModel", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.dictionaryPart", "serializationOptions": { - "xml": { - "name": "optionalNestedModel", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "application/json" + ], + "name": "dictionaryPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "506", + "$id": "622", "kind": "property", - "name": "metadata", + "name": "dictionaryModelPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "metadata", - "doc": "A dictionary property", + "serializedName": "dictionaryModelPart", "type": { - "$id": "507", + "$id": "623", "kind": "dict", "keyType": { - "$id": "508", + "$id": "624", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "509", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "342" }, "decorators": [] }, @@ -6771,81 +8453,106 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.metadata", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.dictionaryModelPart", + "serializationOptions": { + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "application/json" + ], + "name": "dictionaryModelPart", + "headers": [] + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "625", + "kind": "property", + "name": "listPart", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "listPart", + "type": { + "$ref": "348" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.listPart", "serializationOptions": { - "xml": { - "name": "metadata", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "application/json" + ], + "name": "listPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "510", + "$id": "626", "kind": "property", - "name": "createdAt", + "name": "listModelPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "createdAt", - "doc": "A date-time property", + "serializedName": "listModelPart", "type": { - "$id": "511", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "512", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] + "$ref": "442" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.createdAt", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.listModelPart", "serializationOptions": { - "xml": { - "name": "createdAt", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "application/json" + ], + "name": "listModelPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "513", + "$id": "627", "kind": "property", - "name": "duration", + "name": "multipleListPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "duration", - "doc": "A duration property", + "serializedName": "multipleListPart", "type": { - "$id": "514", - "kind": "duration", - "name": "duration", - "encode": "ISO8601", - "wireType": { - "$id": "515", + "$id": "628", + "kind": "array", + "name": "ArrayHttpPart", + "valueType": { + "$id": "629", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "crossLanguageDefinitionId": "TypeSpec.duration", + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, "optional": false, @@ -6853,90 +8560,253 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.duration", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.multipleListPart", "serializationOptions": { - "xml": { - "name": "duration", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": true, + "defaultContentTypes": [ + "text/plain" + ], + "name": "multipleListPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "516", + "$id": "630", "kind": "property", - "name": "data", + "name": "profileImage", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "data", - "doc": "A bytes property", + "serializedName": "profileImage", "type": { - "$id": "517", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] + "$id": "631", + "kind": "model", + "name": "File", + "apiVersions": [], + "namespace": "TypeSpec.Http", + "crossLanguageDefinitionId": "TypeSpec.Http.File", + "usage": "Input", + "doc": "A file in an HTTP request, response, or multipart payload.\n\nFiles have a special meaning that the HTTP library understands. When the body of an HTTP request, response,\nor multipart payload is _effectively_ an instance of `TypeSpec.Http.File` or any type that extends it, the\noperation is treated as a file upload or download.\n\nWhen using file bodies, the fields of the file model are defined to come from particular locations by default:\n\n- `contentType`: The `Content-Type` header of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `contents`: The body of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `filename`: The `filename` parameter value of the `Content-Disposition` header of the response or multipart payload\n(MAY be overridden or changed).\n\nA File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit\n`Content-Type` header. In this case, the entire File model is serialized as if it were any other model. In a JSON payload,\nit will have a structure like:\n\n```\n{\n \"contentType\": ,\n \"filename\": ,\n \"contents\": \n}\n```\n\nThe `contentType` _within_ the file defines what media types the data inside the file can be, but if the specification\ndefines a `Content-Type` for the payload as HTTP metadata, that `Content-Type` metadata defines _how the file is\nserialized_. See the examples below for more information.\n\nNOTE: The `filename` and `contentType` fields are optional. Furthermore, the default location of `filename`\n(`Content-Disposition: ; filename=`) is only valid in HTTP responses and multipart payloads. If\nyou wish to send the `filename` in a request, you must use HTTP metadata decorators to describe the location of the\n`filename` field. You can combine the metadata decorators with `@visibility` to control when the `filename` location\nis overridden, as shown in the examples below.", + "summary": "A file in an HTTP request, response, or multipart payload.", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, + "isFileType": true, + "properties": [ + { + "$id": "632", + "kind": "property", + "name": "contentType", + "apiVersions": [], + "summary": "The allowed media (MIME) types of the file contents.", + "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", + "type": { + "$id": "633", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.File.contentType", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "634", + "kind": "property", + "name": "filename", + "apiVersions": [], + "summary": "The name of the file, if any.", + "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", + "type": { + "$id": "635", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.File.filename", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "636", + "kind": "property", + "name": "contents", + "apiVersions": [], + "summary": "The contents of the file.", + "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", + "type": { + "$id": "637", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.File.contents", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + } + ] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.data", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.profileImage", "serializationOptions": { - "xml": { - "name": "data", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": true, + "isMulti": false, + "filename": { + "$id": "638", + "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", + "summary": "The name of the file, if any.", + "apiVersions": [], + "type": { + "$id": "639", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "name": "filename", + "isGeneratedName": false, + "isExactName": false, + "optional": true, + "isApiVersionParam": false, + "onClient": false, + "crossLanguageDefinitionId": "TypeSpec.Http.File.filename", + "decorators": [], + "visibility": [ + 1, + 2, + 4, + 8, + 16 + ], + "access": "public", + "flatten": false, + "kind": "property", + "discriminator": false, + "serializedName": "filename", + "isMultipartFileInput": false, + "serializationOptions": {} + }, + "contentType": { + "$id": "640", + "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", + "summary": "The allowed media (MIME) types of the file contents.", + "apiVersions": [], + "type": { + "$id": "641", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "name": "contentType", + "isGeneratedName": false, + "isExactName": false, + "optional": true, + "isApiVersionParam": false, + "onClient": false, + "crossLanguageDefinitionId": "TypeSpec.Http.File.contentType", + "decorators": [], + "visibility": [ + 1, + 2, + 4, + 8, + 16 + ], + "access": "public", + "flatten": false, + "kind": "property", + "discriminator": false, + "serializedName": "contentType", + "isMultipartFileInput": false, + "serializationOptions": {} + }, + "defaultContentTypes": [ + "*/*" + ], + "name": "profileImage", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "518", + "$id": "642", "kind": "property", - "name": "optionalRecordUnknown", + "name": "extensibleEnumPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalRecordUnknown", - "doc": "optional record of unknown", + "serializedName": "extensibleEnumPart", "type": { - "$ref": "360" + "$ref": "27" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalRecordUnknown", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.extensibleEnumPart", "serializationOptions": { - "xml": { - "name": "optionalRecordUnknown", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "extensibleEnumPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "519", + "$id": "643", "kind": "property", - "name": "fixedEnum", + "name": "fixedEnumPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "fixedEnum", - "doc": "A fixed enum property", + "serializedName": "fixedEnumPart", "type": { "$ref": "17" }, @@ -6945,422 +8815,585 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.fixedEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.fixedEnumPart", "serializationOptions": { - "xml": { - "name": "fixedEnum", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "application/json" + ], + "name": "fixedEnumPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "520", + "$id": "644", "kind": "property", - "name": "extensibleEnum", + "name": "intExtensibleEnumPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "extensibleEnum", - "doc": "An extensible enum property", + "serializedName": "intExtensibleEnumPart", "type": { - "$ref": "27" + "$ref": "37" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.extensibleEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.intExtensibleEnumPart", "serializationOptions": { - "xml": { - "name": "extensibleEnum", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "text/plain" + ], + "name": "intExtensibleEnumPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "521", + "$id": "645", "kind": "property", - "name": "optionalFixedEnum", + "name": "intFixedEnumPart", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalFixedEnum", - "doc": "An optional fixed enum property", + "serializedName": "intFixedEnumPart", "type": { "$ref": "62" }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalFixedEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.Cat.intFixedEnumPart", "serializationOptions": { - "xml": { - "name": "optionalFixedEnum", - "attribute": false, - "unwrapped": false + "multipart": { + "isFilePart": false, + "isMulti": false, + "defaultContentTypes": [ + "application/json" + ], + "name": "intFixedEnumPart", + "headers": [] } }, "isHttpMetadata": false, "isExactName": false + } + ] + }, + { + "$id": "646", + "kind": "model", + "name": "File", + "apiVersions": [], + "namespace": "TypeSpec.Http", + "crossLanguageDefinitionId": "TypeSpec.Http.File", + "usage": "Input", + "doc": "A file in an HTTP request, response, or multipart payload.\n\nFiles have a special meaning that the HTTP library understands. When the body of an HTTP request, response,\nor multipart payload is _effectively_ an instance of `TypeSpec.Http.File` or any type that extends it, the\noperation is treated as a file upload or download.\n\nWhen using file bodies, the fields of the file model are defined to come from particular locations by default:\n\n- `contentType`: The `Content-Type` header of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `contents`: The body of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `filename`: The `filename` parameter value of the `Content-Disposition` header of the response or multipart payload\n(MAY be overridden or changed).\n\nA File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit\n`Content-Type` header. In this case, the entire File model is serialized as if it were any other model. In a JSON payload,\nit will have a structure like:\n\n```\n{\n \"contentType\": ,\n \"filename\": ,\n \"contents\": \n}\n```\n\nThe `contentType` _within_ the file defines what media types the data inside the file can be, but if the specification\ndefines a `Content-Type` for the payload as HTTP metadata, that `Content-Type` metadata defines _how the file is\nserialized_. See the examples below for more information.\n\nNOTE: The `filename` and `contentType` fields are optional. Furthermore, the default location of `filename`\n(`Content-Disposition: ; filename=`) is only valid in HTTP responses and multipart payloads. If\nyou wish to send the `filename` in a request, you must use HTTP metadata decorators to describe the location of the\n`filename` field. You can combine the metadata decorators with `@visibility` to control when the `filename` location\nis overridden, as shown in the examples below.", + "summary": "A file in an HTTP request, response, or multipart payload.", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, + "isFileType": true, + "properties": [ + { + "$ref": "632" }, { - "$id": "522", + "$ref": "634" + }, + { + "$ref": "636" + } + ] + }, + { + "$id": "647", + "kind": "model", + "name": "StreamingItem", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.StreamingItem", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "StreamingItem" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "648", "kind": "property", - "name": "optionalExtensibleEnum", + "name": "message", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "optionalExtensibleEnum", - "doc": "An optional extensible enum property", + "serializedName": "message", "type": { - "$ref": "37" + "$id": "649", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "optional": true, + "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.optionalExtensibleEnum", + "crossLanguageDefinitionId": "SampleTypeSpec.StreamingItem.message", "serializationOptions": { - "xml": { - "name": "optionalExtensibleEnum", - "attribute": false, - "unwrapped": false + "json": { + "name": "message" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "650", + "kind": "model", + "name": "PreviewDetails", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.PreviewDetails", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "PreviewDetails" + } + }, + "isExactName": false, + "properties": [ { - "$id": "523", + "$id": "651", "kind": "property", - "name": "label", + "name": "choice", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "label", + "serializedName": "choice", "type": { - "$id": "524", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "79" }, "optional": false, "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@ns", - "arguments": { - "ns": { - "$id": "525", - "kind": "enumvalue", - "decorators": [], - "name": "ns1", - "isExactName": false, - "value": "https://example.com/ns1", - "enumType": { - "$id": "526", - "kind": "enum", - "decorators": [ - { - "name": "TypeSpec.Xml.@nsDeclarations", - "arguments": {} - } - ], - "name": "XmlNamespaces", - "isGeneratedName": false, - "isExactName": false, - "namespace": "SampleTypeSpec", - "valueType": { - "$id": "527", - "kind": "string", - "decorators": [], - "doc": "A sequence of textual characters.", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "values": [ - { - "$id": "528", - "kind": "enumvalue", - "decorators": [], - "name": "ns1", - "isExactName": false, - "value": "https://example.com/ns1", - "enumType": { - "$ref": "526" - }, - "valueType": { - "$ref": "527" - }, - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" - }, - { - "$id": "529", - "kind": "enumvalue", - "decorators": [], - "name": "ns2", - "isExactName": false, - "value": "https://example.com/ns2", - "enumType": { - "$ref": "526" - }, - "valueType": { - "$ref": "527" - }, - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "access": "public", - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "isUnionAsEnum": false, - "__accessSet": true - }, - "valueType": { - "$ref": "527" - }, - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" - } - } - }, - { - "name": "TypeSpec.Xml.@attribute", - "arguments": {} + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PreviewDetails.choice", + "serializationOptions": { + "json": { + "name": "choice" } + }, + "isHttpMetadata": false, + "isExactName": false + } + ], + "experimental": { + "diagnosticId": "SAMPLE0003", + "dependsOn": [ + "SAMPLE0004" + ] + } + }, + { + "$id": "652", + "kind": "model", + "name": "LifecycleModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.LifecycleModel", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "LifecycleModel" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "653", + "kind": "property", + "name": "preview", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.label", + "serializedName": "preview", + "type": { + "$ref": "650" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.LifecycleModel.preview", "serializationOptions": { - "xml": { - "name": "label", - "attribute": true, - "ns": { - "namespace": "https://example.com/ns1", - "prefix": "ns1" - }, - "unwrapped": false + "json": { + "name": "preview" } }, "isHttpMetadata": false, - "isExactName": false + "isExactName": false, + "experimental": { + "diagnosticId": "SAMPLE0008", + "dependsOn": [ + "SAMPLE0003" + ] + } }, { - "$id": "530", + "$id": "654", "kind": "property", - "name": "daysUsed", + "name": "choice", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "daysUsed", + "serializedName": "choice", "type": { - "$id": "531", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] + "$ref": "83" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@ns", - "arguments": { - "ns": { - "$id": "532", - "kind": "enumvalue", - "decorators": [], - "name": "ns2", - "isExactName": false, - "value": "https://example.com/ns2", - "enumType": { - "$ref": "526" - }, - "valueType": { - "$ref": "527" - }, - "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" - } - } - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.daysUsed", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.LifecycleModel.choice", "serializationOptions": { - "xml": { - "name": "daysUsed", - "attribute": false, - "ns": { - "namespace": "https://example.com/ns2", - "prefix": "ns2" - }, - "unwrapped": false + "json": { + "name": "choice" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "655", + "kind": "model", + "name": "PagePreviewDetails", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Page", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "Page" + } + }, + "isExactName": false, + "properties": [ { - "$id": "533", + "$id": "656", "kind": "property", - "name": "fooItems", + "name": "items", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "fooItems", + "serializedName": "items", "type": { - "$ref": "300" + "$id": "657", + "kind": "array", + "name": "ArrayPreviewDetails", + "valueType": { + "$ref": "650" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@ns", - "arguments": { - "ns": "http://www.contoso.com/anotherbook.dtd", - "prefix": "foo" - } - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.fooItems", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Page.items", "serializationOptions": { - "xml": { - "name": "fooItems", - "attribute": false, - "ns": { - "namespace": "http://www.contoso.com/anotherbook.dtd", - "prefix": "foo" - }, - "unwrapped": false, - "itemsName": "string" + "json": { + "name": "items" } }, "isHttpMetadata": false, "isExactName": false + } + ] + }, + { + "$id": "658", + "kind": "model", + "name": "Animal", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Animal", + "usage": "Input,Output,Json", + "doc": "Base animal with discriminator", + "decorators": [], + "serializationOptions": { + "json": { + "name": "Animal" + } + }, + "isExactName": false, + "discriminatorProperty": { + "$id": "659", + "kind": "property", + "name": "kind", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "kind", + "doc": "The kind of animal", + "type": { + "$id": "660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Animal.kind", + "serializationOptions": { + "json": { + "name": "kind" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + "properties": [ + { + "$ref": "659" }, { - "$id": "534", + "$id": "661", "kind": "property", - "name": "anotherModel", + "name": "name", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "anotherModel", + "serializedName": "name", + "doc": "Name of the animal", "type": { - "$ref": "500" + "$id": "662", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@ns", - "arguments": { - "ns": "http://www.contoso.com/anothermodel.dtd", - "prefix": "bar" - } - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.anotherModel", - "serializationOptions": { - "xml": { - "name": "anotherModel", - "attribute": false, - "ns": { - "namespace": "http://www.contoso.com/anothermodel.dtd", - "prefix": "bar" - }, - "unwrapped": false + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Animal.name", + "serializationOptions": { + "json": { + "name": "name" } }, "isHttpMetadata": false, "isExactName": false - }, - { - "$id": "535", - "kind": "property", - "name": "modelsWithNamespaces", + } + ], + "discriminatedSubtypes": { + "pet": { + "$id": "663", + "kind": "model", + "name": "Pet", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "modelsWithNamespaces", - "type": { - "$id": "536", - "kind": "array", - "name": "ArrayXmlModelWithNamespace", - "valueType": { - "$id": "537", - "kind": "model", - "name": "XmlModelWithNamespace", + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Pet", + "usage": "Input,Output,Json", + "doc": "Pet is a discriminated animal", + "discriminatorValue": "pet", + "decorators": [], + "serializationOptions": { + "json": { + "name": "Pet" + } + }, + "isExactName": false, + "discriminatorProperty": { + "$id": "664", + "kind": "property", + "name": "kind", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "kind", + "type": { + "$ref": "110" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Pet.kind", + "serializationOptions": { + "json": { + "name": "kind" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + "baseModel": { + "$ref": "658" + }, + "properties": [ + { + "$ref": "664" + }, + { + "$id": "665", + "kind": "property", + "name": "trained", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.XmlModelWithNamespace", - "usage": "Input,Output,Xml", - "decorators": [ - { - "name": "TypeSpec.Xml.@ns", - "arguments": { - "ns": "http://www.example.com/namespace", - "prefix": "ns1" - } + "serializedName": "trained", + "doc": "Whether the pet is trained", + "type": { + "$id": "666", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Pet.trained", + "serializationOptions": { + "json": { + "name": "trained" } + }, + "isHttpMetadata": false, + "isExactName": false + } + ], + "discriminatedSubtypes": { + "dog": { + "$id": "667", + "kind": "model", + "name": "Dog", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Dog", + "usage": "Input,Output,Json", + "doc": "Dog is a specific type of pet with hierarchy building", + "discriminatorValue": "dog", + "decorators": [], "serializationOptions": { - "xml": { - "name": "XmlModelWithNamespace", - "attribute": false, - "ns": { - "namespace": "http://www.example.com/namespace", - "prefix": "ns1" - }, - "unwrapped": false + "json": { + "name": "Dog" } }, "isExactName": false, + "baseModel": { + "$ref": "663" + }, "properties": [ { - "$id": "538", + "$id": "668", "kind": "property", - "name": "foo", + "name": "kind", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "foo", + "serializedName": "kind", + "type": { + "$ref": "112" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Dog.kind", + "serializationOptions": { + "json": { + "name": "kind" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "669", + "kind": "property", + "name": "breed", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "breed", + "doc": "The breed of the dog", "type": { - "$id": "539", + "$id": "670", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7371,250 +9404,245 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlModelWithNamespace.foo", + "crossLanguageDefinitionId": "SampleTypeSpec.Dog.breed", "serializationOptions": { - "xml": { - "name": "foo", - "attribute": false, - "unwrapped": false + "json": { + "name": "breed" } }, "isHttpMetadata": false, "isExactName": false } ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.modelsWithNamespaces", - "serializationOptions": { - "xml": { - "name": "modelsWithNamespaces", - "attribute": false, - "unwrapped": false, - "itemsName": "XmlModelWithNamespace", - "itemsNs": { - "namespace": "http://www.example.com/namespace", - "prefix": "ns1" - } } - }, - "isHttpMetadata": false, - "isExactName": false + } }, - { - "$id": "540", - "kind": "property", - "name": "unwrappedModelsWithNamespaces", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "unwrappedModelsWithNamespaces", - "type": { - "$ref": "536" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "name": "TypeSpec.Xml.@unwrapped", - "arguments": {} - } - ], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.unwrappedModelsWithNamespaces", - "serializationOptions": { - "xml": { - "name": "unwrappedModelsWithNamespaces", - "attribute": false, - "unwrapped": true, - "itemsName": "unwrappedModelsWithNamespaces" - } + "dog": { + "$ref": "667" + } + } + }, + { + "$ref": "663" + }, + { + "$ref": "667" + }, + { + "$id": "671", + "kind": "model", + "name": "Tree", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Tree", + "usage": "Input,Output,Json,Xml", + "doc": "Tree is a specific type of plant", + "discriminatorValue": "tree", + "decorators": [], + "serializationOptions": { + "xml": { + "name": "Tree", + "attribute": false, + "unwrapped": false + }, + "json": { + "name": "Tree" + } + }, + "isExactName": false, + "baseModel": { + "$id": "672", + "kind": "model", + "name": "Plant", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Plant", + "usage": "Input,Output,Json,Xml", + "doc": "Base plant with discriminator", + "decorators": [], + "serializationOptions": { + "xml": { + "name": "Plant", + "attribute": false, + "unwrapped": false }, - "isHttpMetadata": false, - "isExactName": false + "json": { + "name": "Plant" + } }, - { - "$id": "541", + "isExactName": false, + "discriminatorProperty": { + "$id": "673", "kind": "property", - "name": "listOfListFoo", + "name": "species", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listOfListFoo", + "serializedName": "species", + "doc": "The species of plant", "type": { - "$id": "542", - "kind": "array", - "name": "ArrayArray1", - "valueType": { - "$ref": "489" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "674", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "optional": false, "readOnly": false, - "discriminator": false, + "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.listOfListFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.Plant.species", "serializationOptions": { "xml": { - "name": "listOfListFoo", + "name": "species", "attribute": false, - "unwrapped": false, - "itemsName": "Array" + "unwrapped": false + }, + "json": { + "name": "species" } }, "isHttpMetadata": false, "isExactName": false }, - { - "$id": "543", - "kind": "property", - "name": "dictionaryFoo", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "dictionaryFoo", - "type": { - "$id": "544", - "kind": "dict", - "keyType": { - "$id": "545", + "properties": [ + { + "$ref": "673" + }, + { + "$id": "675", + "kind": "property", + "name": "id", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "id", + "doc": "The unique identifier of the plant", + "type": { + "$id": "676", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "valueType": { - "$ref": "490" + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Plant.id", + "serializationOptions": { + "xml": { + "name": "id", + "attribute": false, + "unwrapped": false + }, + "json": { + "name": "id" + } }, - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.dictionaryFoo", - "serializationOptions": { - "xml": { - "name": "dictionaryFoo", - "attribute": false, - "unwrapped": false - } + "isHttpMetadata": false, + "isExactName": false }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "546", - "kind": "property", - "name": "dictionaryOfDictionaryFoo", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "dictionaryOfDictionaryFoo", - "type": { - "$id": "547", - "kind": "dict", - "keyType": { - "$id": "548", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + { + "$id": "677", + "kind": "property", + "name": "height", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "height", + "doc": "The height of the plant in centimeters", + "type": { + "$id": "678", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, - "valueType": { - "$ref": "544" + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Plant.height", + "serializationOptions": { + "xml": { + "name": "height", + "attribute": false, + "unwrapped": false + }, + "json": { + "name": "height" + } }, - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.dictionaryOfDictionaryFoo", - "serializationOptions": { - "xml": { - "name": "dictionaryOfDictionaryFoo", - "attribute": false, - "unwrapped": false - } - }, - "isHttpMetadata": false, - "isExactName": false - }, + "isHttpMetadata": false, + "isExactName": false + } + ], + "discriminatedSubtypes": { + "tree": { + "$ref": "671" + } + } + }, + "properties": [ { - "$id": "549", + "$id": "679", "kind": "property", - "name": "dictionaryListFoo", + "name": "species", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "dictionaryListFoo", + "serializedName": "species", "type": { - "$id": "550", - "kind": "dict", - "keyType": { - "$id": "551", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "489" - }, - "decorators": [] + "$ref": "114" }, "optional": false, "readOnly": false, - "discriminator": false, + "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.dictionaryListFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.Tree.species", "serializationOptions": { "xml": { - "name": "dictionaryListFoo", + "name": "species", "attribute": false, "unwrapped": false + }, + "json": { + "name": "species" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "552", + "$id": "680", "kind": "property", - "name": "listOfDictionaryFoo", + "name": "age", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listOfDictionaryFoo", + "serializedName": "age", + "doc": "The age of the tree in years", "type": { - "$id": "553", - "kind": "array", - "name": "ArrayRecord1", - "valueType": { - "$ref": "544" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "681", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, "optional": false, @@ -7622,127 +9650,131 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.XmlAdvancedModel.listOfDictionaryFoo", + "crossLanguageDefinitionId": "SampleTypeSpec.Tree.age", "serializationOptions": { "xml": { - "name": "listOfDictionaryFoo", + "name": "age", "attribute": false, - "unwrapped": false, - "itemsName": "Record" + "unwrapped": false + }, + "json": { + "name": "age" } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$ref": "490" - }, - { - "$ref": "500" - }, - { - "$ref": "537" - }, - { - "$id": "554", - "kind": "model", - "name": "Cat", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Cat", - "usage": "Input,MultipartFormData", - "decorators": [], - "serializationOptions": {}, - "isExactName": false, - "properties": [ + }, { - "$id": "555", + "$id": "682", "kind": "property", - "name": "id", + "name": "nullableText", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "id", + "serializedName": "nullableText", "type": { - "$id": "556", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$id": "683", + "kind": "nullable", + "type": { + "$id": "684", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.id", + "crossLanguageDefinitionId": "SampleTypeSpec.Tree.nullableText", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "id", - "headers": [] + "xml": { + "name": "nullableText", + "attribute": false, + "unwrapped": false + }, + "json": { + "name": "nullableText" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "557", + "$id": "685", "kind": "property", - "name": "boolPart", + "name": "nullableLabels", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "boolPart", + "serializedName": "nullableLabels", "type": { - "$id": "558", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] + "$id": "686", + "kind": "nullable", + "type": { + "$ref": "555" + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.boolPart", + "crossLanguageDefinitionId": "SampleTypeSpec.Tree.nullableLabels", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "boolPart", - "headers": [] + "xml": { + "name": "nullableLabels", + "attribute": false, + "unwrapped": false + }, + "json": { + "name": "nullableLabels" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$ref": "672" + }, + { + "$id": "687", + "kind": "model", + "name": "GetWidgetMetricsResponse", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [ { - "$id": "559", + "$id": "688", "kind": "property", - "name": "int32Part", + "name": "numSold", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "int32Part", + "serializedName": "numSold", "type": { - "$id": "560", + "$id": "689", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7753,35 +9785,29 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.int32Part", + "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous.numSold", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "int32Part", - "headers": [] + "json": { + "name": "numSold" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "561", + "$id": "690", "kind": "property", - "name": "int64Part", + "name": "averagePrice", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "int64Part", + "serializedName": "averagePrice", "type": { - "$id": "562", - "kind": "int64", - "name": "int64", - "crossLanguageDefinitionId": "TypeSpec.int64", + "$id": "691", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", "decorators": [] }, "optional": false, @@ -7789,35 +9815,50 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.int64Part", + "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous.averagePrice", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "int64Part", - "headers": [] + "json": { + "name": "averagePrice" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "692", + "kind": "model", + "name": "GetNotebookResponse", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.getNotebook.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, + "isExactName": false, + "properties": [ { - "$id": "563", + "$id": "693", "kind": "property", - "name": "float32Part", + "name": "name", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "float32Part", + "serializedName": "name", "type": { - "$id": "564", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", + "$id": "694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "optional": false, @@ -7825,35 +9866,29 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.float32Part", + "crossLanguageDefinitionId": "SampleTypeSpec.getNotebook.Response.anonymous.name", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "float32Part", - "headers": [] + "json": { + "name": "name" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "565", + "$id": "695", "kind": "property", - "name": "float64Part", + "name": "content", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "float64Part", + "serializedName": "content", "type": { - "$id": "566", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", + "$id": "696", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "optional": false, @@ -7861,290 +9896,526 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.float64Part", + "crossLanguageDefinitionId": "SampleTypeSpec.getNotebook.Response.anonymous.content", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "float64Part", - "headers": [] + "json": { + "name": "content" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "697", + "kind": "model", + "name": "NullableDynamicModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel", + "access": "public", + "usage": "Input,Json", + "decorators": [ { - "$id": "567", + "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", + "arguments": {} + } + ], + "serializationOptions": { + "json": { + "name": "NullableDynamicModel" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "698", "kind": "property", - "name": "decimalPart", + "name": "modelValue", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "decimalPart", + "serializedName": "modelValue", "type": { - "$id": "568", - "kind": "decimal128", - "name": "decimal128", - "crossLanguageDefinitionId": "TypeSpec.decimal128", - "decorators": [] + "$id": "699", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.decimalPart", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.modelValue", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "decimalPart", - "headers": [] + "json": { + "name": "modelValue" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "569", + "$id": "700", "kind": "property", - "name": "int8Part", + "name": "children", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "int8Part", - "type": { - "$id": "570", - "kind": "int8", - "name": "int8", - "crossLanguageDefinitionId": "TypeSpec.int8", - "decorators": [] + "serializedName": "children", + "type": { + "$id": "701", + "kind": "nullable", + "type": { + "$id": "702", + "kind": "array", + "name": "Array10", + "valueType": { + "$id": "703", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.int8Part", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.children", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "int8Part", - "headers": [] + "json": { + "name": "children" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "571", + "$id": "704", "kind": "property", - "name": "uint8Part", + "name": "childDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "uint8Part", + "serializedName": "childDictionary", "type": { - "$id": "572", - "kind": "uint8", - "name": "uint8", - "crossLanguageDefinitionId": "TypeSpec.uint8", - "decorators": [] + "$id": "705", + "kind": "nullable", + "type": { + "$id": "706", + "kind": "dict", + "keyType": { + "$id": "707", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "708", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.uint8Part", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.childDictionary", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "uint8Part", - "headers": [] + "json": { + "name": "childDictionary" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "573", + "$id": "709", "kind": "property", - "name": "dictionaryPart", + "name": "nestedChildren", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "dictionaryPart", + "serializedName": "nestedChildren", "type": { - "$ref": "507" + "$id": "710", + "kind": "nullable", + "type": { + "$id": "711", + "kind": "array", + "name": "Array11", + "valueType": { + "$id": "712", + "kind": "nullable", + "type": { + "$id": "713", + "kind": "array", + "name": "Array12", + "valueType": { + "$id": "714", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.dictionaryPart", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildren", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "application/json" - ], - "name": "dictionaryPart", - "headers": [] + "json": { + "name": "nestedChildren" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "574", + "$id": "715", "kind": "property", - "name": "dictionaryModelPart", + "name": "nestedChildDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "dictionaryModelPart", + "serializedName": "nestedChildDictionary", "type": { - "$id": "575", - "kind": "dict", - "keyType": { - "$id": "576", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "716", + "kind": "nullable", + "type": { + "$id": "717", + "kind": "dict", + "keyType": { + "$id": "718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "719", + "kind": "nullable", + "type": { + "$id": "720", + "kind": "dict", + "keyType": { + "$id": "721", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "722", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, "decorators": [] }, - "valueType": { - "$ref": "294" - }, - "decorators": [] + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.dictionaryModelPart", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildDictionary", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "application/json" - ], - "name": "dictionaryModelPart", - "headers": [] + "json": { + "name": "nestedChildDictionary" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "577", + "$id": "723", "kind": "property", - "name": "listPart", + "name": "dictionaryChildren", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listPart", + "serializedName": "dictionaryChildren", "type": { - "$ref": "300" + "$id": "724", + "kind": "nullable", + "type": { + "$id": "725", + "kind": "dict", + "keyType": { + "$id": "726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "727", + "kind": "nullable", + "type": { + "$id": "728", + "kind": "array", + "name": "Array13", + "valueType": { + "$id": "729", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.listPart", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.dictionaryChildren", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "application/json" - ], - "name": "listPart", - "headers": [] + "json": { + "name": "dictionaryChildren" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "578", + "$id": "730", "kind": "property", - "name": "listModelPart", + "name": "listOfDictionaries", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listModelPart", + "serializedName": "listOfDictionaries", "type": { - "$ref": "394" + "$id": "731", + "kind": "nullable", + "type": { + "$id": "732", + "kind": "array", + "name": "Array14", + "valueType": { + "$id": "733", + "kind": "nullable", + "type": { + "$id": "734", + "kind": "dict", + "keyType": { + "$id": "735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "736", + "kind": "nullable", + "type": { + "$ref": "488" + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.listModelPart", + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.listOfDictionaries", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "application/json" - ], - "name": "listModelPart", - "headers": [] + "json": { + "name": "listOfDictionaries" } }, "isHttpMetadata": false, "isExactName": false + } + ] + }, + { + "$id": "737", + "kind": "model", + "name": "OptionalNullableDynamicProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableDynamicProperties", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [ + { + "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", + "arguments": {} + } + ], + "serializationOptions": { + "json": { + "name": "OptionalNullableDynamicProperties" + } + }, + "isExactName": false, + "baseModel": { + "$id": "738", + "kind": "model", + "name": "OptionalNullableBase", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableBase" + } }, + "isExactName": false, + "properties": [ + { + "$id": "739", + "kind": "property", + "name": "inheritedNullable", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "inheritedNullable", + "type": { + "$id": "740", + "kind": "nullable", + "type": { + "$id": "741", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase.inheritedNullable", + "serializationOptions": { + "json": { + "name": "inheritedNullable" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + "properties": [] + }, + { + "$ref": "738" + }, + { + "$id": "742", + "kind": "model", + "name": "OptionalNullableChild", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableChild" + } + }, + "isExactName": false, + "properties": [ { - "$id": "579", + "$id": "743", "kind": "property", - "name": "multipleListPart", + "name": "value", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "multipleListPart", + "serializedName": "value", "type": { - "$id": "580", - "kind": "array", - "name": "ArrayHttpPart", - "valueType": { - "$id": "581", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "744", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "optional": false, @@ -8152,598 +10423,510 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.multipleListPart", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild.value", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": true, - "defaultContentTypes": [ - "text/plain" - ], - "name": "multipleListPart", - "headers": [] + "json": { + "name": "value" } }, "isHttpMetadata": false, "isExactName": false - }, + } + ] + }, + { + "$id": "745", + "kind": "model", + "name": "OptionalNullableProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableProperties" + } + }, + "isExactName": false, + "baseModel": { + "$ref": "738" + }, + "properties": [ { - "$id": "582", + "$id": "746", "kind": "property", - "name": "profileImage", + "name": "nullableModel", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" - ], - "serializedName": "profileImage", - "type": { - "$id": "583", - "kind": "model", - "name": "File", - "apiVersions": [], - "namespace": "TypeSpec.Http", - "crossLanguageDefinitionId": "TypeSpec.Http.File", - "usage": "Input", - "doc": "A file in an HTTP request, response, or multipart payload.\n\nFiles have a special meaning that the HTTP library understands. When the body of an HTTP request, response,\nor multipart payload is _effectively_ an instance of `TypeSpec.Http.File` or any type that extends it, the\noperation is treated as a file upload or download.\n\nWhen using file bodies, the fields of the file model are defined to come from particular locations by default:\n\n- `contentType`: The `Content-Type` header of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `contents`: The body of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `filename`: The `filename` parameter value of the `Content-Disposition` header of the response or multipart payload\n(MAY be overridden or changed).\n\nA File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit\n`Content-Type` header. In this case, the entire File model is serialized as if it were any other model. In a JSON payload,\nit will have a structure like:\n\n```\n{\n \"contentType\": ,\n \"filename\": ,\n \"contents\": \n}\n```\n\nThe `contentType` _within_ the file defines what media types the data inside the file can be, but if the specification\ndefines a `Content-Type` for the payload as HTTP metadata, that `Content-Type` metadata defines _how the file is\nserialized_. See the examples below for more information.\n\nNOTE: The `filename` and `contentType` fields are optional. Furthermore, the default location of `filename`\n(`Content-Disposition: ; filename=`) is only valid in HTTP responses and multipart payloads. If\nyou wish to send the `filename` in a request, you must use HTTP metadata decorators to describe the location of the\n`filename` field. You can combine the metadata decorators with `@visibility` to control when the `filename` location\nis overridden, as shown in the examples below.", - "summary": "A file in an HTTP request, response, or multipart payload.", - "decorators": [], - "serializationOptions": {}, - "isExactName": false, - "isFileType": true, - "properties": [ - { - "$id": "584", - "kind": "property", - "name": "contentType", - "apiVersions": [], - "summary": "The allowed media (MIME) types of the file contents.", - "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", - "type": { - "$id": "585", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.File.contentType", - "serializationOptions": {}, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "586", - "kind": "property", - "name": "filename", - "apiVersions": [], - "summary": "The name of the file, if any.", - "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", - "type": { - "$id": "587", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.File.filename", - "serializationOptions": {}, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "588", - "kind": "property", - "name": "contents", - "apiVersions": [], - "summary": "The contents of the file.", - "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", - "type": { - "$id": "589", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.File.contents", - "serializationOptions": {}, - "isHttpMetadata": false, - "isExactName": false - } - ] + ], + "serializedName": "nullableModel", + "type": { + "$id": "747", + "kind": "nullable", + "type": { + "$ref": "742" + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.profileImage", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableModel", "serializationOptions": { - "multipart": { - "isFilePart": true, - "isMulti": false, - "filename": { - "$id": "590", - "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", - "summary": "The name of the file, if any.", - "apiVersions": [], - "type": { - "$id": "591", - "kind": "string", - "decorators": [], - "doc": "A sequence of textual characters.", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "name": "filename", - "isGeneratedName": false, - "isExactName": false, - "optional": true, - "isApiVersionParam": false, - "onClient": false, - "crossLanguageDefinitionId": "TypeSpec.Http.File.filename", - "decorators": [], - "visibility": [ - 1, - 2, - 4, - 8, - 16 - ], - "access": "public", - "flatten": false, - "kind": "property", - "discriminator": false, - "serializedName": "filename", - "isMultipartFileInput": false, - "serializationOptions": {} - }, - "contentType": { - "$id": "592", - "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", - "summary": "The allowed media (MIME) types of the file contents.", - "apiVersions": [], - "type": { - "$id": "593", - "kind": "string", - "decorators": [], - "doc": "A sequence of textual characters.", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "name": "contentType", - "isGeneratedName": false, - "isExactName": false, - "optional": true, - "isApiVersionParam": false, - "onClient": false, - "crossLanguageDefinitionId": "TypeSpec.Http.File.contentType", - "decorators": [], - "visibility": [ - 1, - 2, - 4, - 8, - 16 - ], - "access": "public", - "flatten": false, - "kind": "property", - "discriminator": false, - "serializedName": "contentType", - "isMultipartFileInput": false, - "serializationOptions": {} - }, - "defaultContentTypes": [ - "*/*" - ], - "name": "profileImage", - "headers": [] + "json": { + "name": "nullableModel" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "594", + "$id": "748", "kind": "property", - "name": "extensibleEnumPart", + "name": "nullableString", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "extensibleEnumPart", + "serializedName": "nullableString", "type": { - "$ref": "27" + "$id": "749", + "kind": "nullable", + "type": { + "$id": "750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.extensibleEnumPart", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableString", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "extensibleEnumPart", - "headers": [] + "json": { + "name": "nullableString" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "595", + "$id": "751", "kind": "property", - "name": "fixedEnumPart", + "name": "nullableInt", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "fixedEnumPart", + "serializedName": "nullableInt", "type": { - "$ref": "17" + "$id": "752", + "kind": "nullable", + "type": { + "$id": "753", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.fixedEnumPart", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableInt", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "application/json" - ], - "name": "fixedEnumPart", - "headers": [] + "json": { + "name": "nullableInt" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "596", + "$id": "754", "kind": "property", - "name": "intExtensibleEnumPart", + "name": "nullableBoolean", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "intExtensibleEnumPart", + "serializedName": "nullableBoolean", "type": { - "$ref": "37" + "$id": "755", + "kind": "nullable", + "type": { + "$id": "756", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.intExtensibleEnumPart", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBoolean", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "text/plain" - ], - "name": "intExtensibleEnumPart", - "headers": [] + "json": { + "name": "nullableBoolean" } }, "isHttpMetadata": false, "isExactName": false }, { - "$id": "597", + "$id": "757", "kind": "property", - "name": "intFixedEnumPart", + "name": "nullableEnum", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "intFixedEnumPart", + "serializedName": "nullableEnum", "type": { - "$ref": "62" + "$id": "758", + "kind": "nullable", + "type": { + "$ref": "17" + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableEnum", + "serializationOptions": { + "json": { + "name": "nullableEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "759", + "kind": "property", + "name": "nullableDateTime", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableDateTime", + "type": { + "$id": "760", + "kind": "nullable", + "type": { + "$id": "761", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDateTime", + "serializationOptions": { + "json": { + "name": "nullableDateTime" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "763", + "kind": "property", + "name": "nullableBytes", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableBytes", + "type": { + "$id": "764", + "kind": "nullable", + "type": { + "$id": "765", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Cat.intFixedEnumPart", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBytes", "serializationOptions": { - "multipart": { - "isFilePart": false, - "isMulti": false, - "defaultContentTypes": [ - "application/json" - ], - "name": "intFixedEnumPart", - "headers": [] + "json": { + "name": "nullableBytes" } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "598", - "kind": "model", - "name": "File", - "apiVersions": [], - "namespace": "TypeSpec.Http", - "crossLanguageDefinitionId": "TypeSpec.Http.File", - "usage": "Input", - "doc": "A file in an HTTP request, response, or multipart payload.\n\nFiles have a special meaning that the HTTP library understands. When the body of an HTTP request, response,\nor multipart payload is _effectively_ an instance of `TypeSpec.Http.File` or any type that extends it, the\noperation is treated as a file upload or download.\n\nWhen using file bodies, the fields of the file model are defined to come from particular locations by default:\n\n- `contentType`: The `Content-Type` header of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `contents`: The body of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `filename`: The `filename` parameter value of the `Content-Disposition` header of the response or multipart payload\n(MAY be overridden or changed).\n\nA File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit\n`Content-Type` header. In this case, the entire File model is serialized as if it were any other model. In a JSON payload,\nit will have a structure like:\n\n```\n{\n \"contentType\": ,\n \"filename\": ,\n \"contents\": \n}\n```\n\nThe `contentType` _within_ the file defines what media types the data inside the file can be, but if the specification\ndefines a `Content-Type` for the payload as HTTP metadata, that `Content-Type` metadata defines _how the file is\nserialized_. See the examples below for more information.\n\nNOTE: The `filename` and `contentType` fields are optional. Furthermore, the default location of `filename`\n(`Content-Disposition: ; filename=`) is only valid in HTTP responses and multipart payloads. If\nyou wish to send the `filename` in a request, you must use HTTP metadata decorators to describe the location of the\n`filename` field. You can combine the metadata decorators with `@visibility` to control when the `filename` location\nis overridden, as shown in the examples below.", - "summary": "A file in an HTTP request, response, or multipart payload.", - "decorators": [], - "serializationOptions": {}, - "isExactName": false, - "isFileType": true, - "properties": [ - { - "$ref": "584" }, { - "$ref": "586" - }, - { - "$ref": "588" - } - ] - }, - { - "$id": "599", - "kind": "model", - "name": "StreamingItem", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.StreamingItem", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "StreamingItem" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "600", + "$id": "766", "kind": "property", - "name": "message", + "name": "nullableList", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "message", + "serializedName": "nullableList", "type": { - "$id": "601", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$id": "767", + "kind": "nullable", + "type": { + "$id": "768", + "kind": "array", + "name": "Array15", + "valueType": { + "$id": "769", + "kind": "nullable", + "type": { + "$id": "770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.StreamingItem.message", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableList", "serializationOptions": { "json": { - "name": "message" + "name": "nullableList" } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "602", - "kind": "model", - "name": "PreviewDetails", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.PreviewDetails", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "PreviewDetails" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "603", + "$id": "771", "kind": "property", - "name": "choice", + "name": "nullableDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "choice", + "serializedName": "nullableDictionary", "type": { - "$ref": "79" + "$id": "772", + "kind": "nullable", + "type": { + "$id": "773", + "kind": "dict", + "keyType": { + "$id": "774", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "775", + "kind": "nullable", + "type": { + "$id": "776", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PreviewDetails.choice", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDictionary", "serializationOptions": { "json": { - "name": "choice" + "name": "nullableDictionary" } }, "isHttpMetadata": false, "isExactName": false - } - ], - "experimental": { - "diagnosticId": "SAMPLE0003", - "dependsOn": [ - "SAMPLE0004" - ] - } - }, - { - "$id": "604", - "kind": "model", - "name": "LifecycleModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.LifecycleModel", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "LifecycleModel" - } - }, - "isExactName": false, - "properties": [ + }, { - "$id": "605", + "$id": "777", "kind": "property", - "name": "preview", + "name": "readOnlyNullable", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "preview", + "serializedName": "readOnlyNullable", "type": { - "$ref": "602" + "$id": "778", + "kind": "nullable", + "type": { + "$id": "779", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, "optional": true, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.LifecycleModel.preview", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.readOnlyNullable", "serializationOptions": { "json": { - "name": "preview" + "name": "readOnlyNullable" } }, "isHttpMetadata": false, - "isExactName": false, - "experimental": { - "diagnosticId": "SAMPLE0008", - "dependsOn": [ - "SAMPLE0003" - ] - } + "isExactName": false }, { - "$id": "606", + "$id": "780", "kind": "property", - "name": "choice", + "name": "requiredNullable", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "choice", + "serializedName": "requiredNullable", "type": { - "$ref": "83" + "$id": "781", + "kind": "nullable", + "type": { + "$id": "782", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.LifecycleModel.choice", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.requiredNullable", "serializationOptions": { "json": { - "name": "choice" + "name": "requiredNullable" } }, "isHttpMetadata": false, "isExactName": false - } - ] - }, - { - "$id": "607", - "kind": "model", - "name": "PagePreviewDetails", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Page", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "Page" - } - }, - "isExactName": false, - "properties": [ + }, + { + "$id": "783", + "kind": "property", + "name": "optionalNonNullable", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalNonNullable", + "type": { + "$id": "784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullable", + "serializationOptions": { + "json": { + "name": "optionalNonNullable" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, { - "$id": "608", + "$id": "785", "kind": "property", - "name": "items", + "name": "optionalNonNullableInt", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "items", + "serializedName": "optionalNonNullableInt", "type": { - "$id": "609", - "kind": "array", - "name": "ArrayPreviewDetails", - "valueType": { - "$ref": "602" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "786", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, - "optional": false, + "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Page.items", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullableInt", "serializationOptions": { "json": { - "name": "items" + "name": "optionalNonNullableInt" } }, "isHttpMetadata": false, @@ -8752,2116 +10935,3221 @@ ] }, { - "$id": "610", + "$id": "787", "kind": "model", - "name": "Animal", + "name": "OptionalNullableContainer", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Animal", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer", + "access": "public", "usage": "Input,Output,Json", - "doc": "Base animal with discriminator", "decorators": [], "serializationOptions": { "json": { - "name": "Animal" + "name": "OptionalNullableContainer" } }, "isExactName": false, - "discriminatorProperty": { - "$id": "611", - "kind": "property", - "name": "kind", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "kind", - "doc": "The kind of animal", - "type": { - "$id": "612", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Animal.kind", - "serializationOptions": { - "json": { - "name": "kind" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, "properties": [ { - "$ref": "611" - }, - { - "$id": "613", + "$id": "788", "kind": "property", - "name": "name", + "name": "child", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "name", - "doc": "Name of the animal", + "serializedName": "child", "type": { - "$id": "614", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "745" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Animal.name", - "serializationOptions": { - "json": { - "name": "name" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ], - "discriminatedSubtypes": { - "pet": { - "$id": "615", - "kind": "model", - "name": "Pet", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Pet", - "usage": "Input,Output,Json", - "doc": "Pet is a discriminated animal", - "discriminatorValue": "pet", - "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer.child", "serializationOptions": { "json": { - "name": "Pet" - } - }, - "isExactName": false, - "discriminatorProperty": { - "$id": "616", - "kind": "property", - "name": "kind", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "kind", - "type": { - "$ref": "110" - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Pet.kind", - "serializationOptions": { - "json": { - "name": "kind" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - "baseModel": { - "$ref": "610" - }, - "properties": [ - { - "$ref": "616" - }, - { - "$id": "617", - "kind": "property", - "name": "trained", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "trained", - "doc": "Whether the pet is trained", - "type": { - "$id": "618", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Pet.trained", - "serializationOptions": { - "json": { - "name": "trained" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ], - "discriminatedSubtypes": { - "dog": { - "$id": "619", - "kind": "model", - "name": "Dog", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Dog", - "usage": "Input,Output,Json", - "doc": "Dog is a specific type of pet with hierarchy building", - "discriminatorValue": "dog", - "decorators": [], - "serializationOptions": { - "json": { - "name": "Dog" - } - }, - "isExactName": false, - "baseModel": { - "$ref": "615" - }, - "properties": [ - { - "$id": "620", - "kind": "property", - "name": "kind", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "kind", - "type": { - "$ref": "112" - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Dog.kind", - "serializationOptions": { - "json": { - "name": "kind" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "621", - "kind": "property", - "name": "breed", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "breed", - "doc": "The breed of the dog", - "type": { - "$id": "622", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Dog.breed", - "serializationOptions": { - "json": { - "name": "breed" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] + "name": "child" } - } - }, - "dog": { - "$ref": "619" + }, + "isHttpMetadata": false, + "isExactName": false } - } - }, - { - "$ref": "615" - }, - { - "$ref": "619" + ] }, { - "$id": "623", + "$id": "789", "kind": "model", - "name": "Tree", + "name": "OptionalNullableFieldNames", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Tree", - "usage": "Input,Output,Json,Xml", - "doc": "Tree is a specific type of plant", - "discriminatorValue": "tree", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames", + "access": "public", + "usage": "Input,Output,Json", "decorators": [], "serializationOptions": { - "xml": { - "name": "Tree", - "attribute": false, - "unwrapped": false - }, "json": { - "name": "Tree" + "name": "OptionalNullableFieldNames" } }, "isExactName": false, - "baseModel": { - "$id": "624", - "kind": "model", - "name": "Plant", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Plant", - "usage": "Input,Output,Json,Xml", - "doc": "Base plant with discriminator", - "decorators": [], - "serializationOptions": { - "xml": { - "name": "Plant", - "attribute": false, - "unwrapped": false - }, - "json": { - "name": "Plant" - } + "additionalProperties": { + "$id": "790", + "kind": "nullable", + "type": { + "$id": "791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "isExactName": false, - "discriminatorProperty": { - "$id": "625", + "namespace": "SampleTypeSpec" + }, + "properties": [ + { + "$id": "792", "kind": "property", - "name": "species", + "name": "additionalStringProperties", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "species", - "doc": "The species of plant", + "serializedName": "additionalStringProperties", "type": { - "$id": "626", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$id": "793", + "kind": "nullable", + "type": { + "$id": "794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "optional": false, + "optional": true, "readOnly": false, - "discriminator": true, + "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Plant.species", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringProperties", "serializationOptions": { - "xml": { - "name": "species", - "attribute": false, - "unwrapped": false - }, "json": { - "name": "species" + "name": "additionalStringProperties" } }, "isHttpMetadata": false, "isExactName": false }, - "properties": [ - { - "$ref": "625" - }, - { - "$id": "627", - "kind": "property", - "name": "id", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "id", - "doc": "The unique identifier of the plant", + { + "$id": "795", + "kind": "property", + "name": "additionalStringPropertiesIsDefined", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "additionalStringPropertiesIsDefined", + "type": { + "$id": "796", + "kind": "nullable", "type": { - "$id": "628", + "$id": "797", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Plant.id", - "serializationOptions": { - "xml": { - "name": "id", - "attribute": false, - "unwrapped": false - }, - "json": { - "name": "id" - } - }, - "isHttpMetadata": false, - "isExactName": false + "namespace": "SampleTypeSpec" }, - { - "$id": "629", - "kind": "property", - "name": "height", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "height", - "doc": "The height of the plant in centimeters", - "type": { - "$id": "630", + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringPropertiesIsDefined", + "serializationOptions": { + "json": { + "name": "additionalStringPropertiesIsDefined" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "798", + "kind": "model", + "name": "UnionAdditionalProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.UnionAdditionalProperties", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionAdditionalProperties" + } + }, + "isExactName": false, + "additionalProperties": { + "$id": "799", + "kind": "nullable", + "type": { + "$id": "800", + "kind": "union", + "name": "UnionAdditionalPropertiesAdditionalProperty", + "variantTypes": [ + { + "$id": "801", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "802", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Plant.height", - "serializationOptions": { - "xml": { - "name": "height", - "attribute": false, - "unwrapped": false - }, - "json": { - "name": "height" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ], - "discriminatedSubtypes": { - "tree": { - "$ref": "623" - } - } + { + "$id": "803", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + ], + "namespace": "SampleTypeSpec", + "decorators": [], + "isExactName": false + }, + "namespace": "SampleTypeSpec" }, + "properties": [] + }, + { + "$id": "804", + "kind": "model", + "name": "JsonlStreamStreamingItem", + "apiVersions": [], + "namespace": "TypeSpec.Http.Streams", + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream", + "usage": "None", + "doc": "", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, "properties": [ { - "$id": "631", + "$id": "805", + "kind": "property", + "name": "contentType", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "type": { + "$ref": "226" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", + "serializationOptions": {}, + "isHttpMetadata": true, + "isExactName": false + }, + { + "$id": "806", "kind": "property", - "name": "species", + "name": "body", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "species", "type": { - "$ref": "114" + "$id": "807", + "kind": "bytes", + "name": "bytes", + "crossLanguageDefinitionId": "", + "decorators": [] }, "optional": false, "readOnly": false, - "discriminator": true, + "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Tree.species", - "serializationOptions": { - "xml": { - "name": "species", - "attribute": false, - "unwrapped": false + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + } + ] + } + ], + "clients": [ + { + "$id": "808", + "kind": "client", + "name": "SampleTypeSpecClient", + "isExactName": false, + "namespace": "SampleTypeSpec", + "doc": "This is a sample typespec project.", + "methods": [ + { + "$id": "809", + "kind": "basic", + "name": "sayHi", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Return hi", + "operation": { + "$id": "810", + "name": "sayHi", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Return hi", + "accessibility": "public", + "parameters": [ + { + "$id": "811", + "kind": "header", + "name": "headParameter", + "serializedName": "head-parameter", + "type": { + "$id": "812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", + "methodParameterSegments": [ + { + "$id": "813", + "kind": "method", + "name": "headParameter", + "serializedName": "head-parameter", + "type": { + "$id": "814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "815", + "kind": "query", + "name": "queryParameter", + "serializedName": "queryParameter", + "type": { + "$id": "816", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "817", + "kind": "method", + "name": "queryParameter", + "serializedName": "queryParameter", + "type": { + "$id": "818", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "819", + "kind": "query", + "name": "optionalQuery", + "serializedName": "optionalQuery", + "type": { + "$id": "820", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "821", + "kind": "method", + "name": "optionalQuery", + "serializedName": "optionalQuery", + "type": { + "$id": "822", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "823", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "116" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", + "methodParameterSegments": [ + { + "$id": "824", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "116" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/hello", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "813" }, - "json": { - "name": "species" + { + "$ref": "817" + }, + { + "$ref": "821" + }, + { + "$ref": "824" + } + ], + "response": { + "type": { + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "632", - "kind": "property", - "name": "age", + "$id": "825", + "kind": "basic", + "name": "helloAgain", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "age", - "doc": "The age of the tree in years", - "type": { - "$id": "633", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Tree.age", - "serializationOptions": { - "xml": { - "name": "age", - "attribute": false, - "unwrapped": false + "doc": "Return hi again", + "operation": { + "$id": "826", + "name": "helloAgain", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Return hi again", + "accessibility": "public", + "parameters": [ + { + "$id": "827", + "kind": "header", + "name": "p1", + "serializedName": "p1", + "type": { + "$id": "828", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", + "methodParameterSegments": [ + { + "$id": "829", + "kind": "method", + "name": "p1", + "serializedName": "p1", + "type": { + "$id": "830", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "831", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "118" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", + "methodParameterSegments": [ + { + "$id": "832", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "118" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "833", + "kind": "path", + "name": "p2", + "serializedName": "p2", + "type": { + "$id": "834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", + "methodParameterSegments": [ + { + "$id": "835", + "kind": "method", + "name": "p2", + "serializedName": "p2", + "type": { + "$id": "836", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "837", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "122" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", + "methodParameterSegments": [ + { + "$id": "838", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "122" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "839", + "kind": "body", + "name": "action", + "serializedName": "action", + "type": { + "$ref": "377" + }, + "isApiVersion": false, + "contentTypes": [ + "text/plain" + ], + "defaultContentType": "text/plain", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", + "methodParameterSegments": [ + { + "$id": "840", + "kind": "method", + "name": "action", + "serializedName": "action", + "type": { + "$ref": "377" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": {} + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "377" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/againHi/{p2}", + "requestMediaTypes": [ + "text/plain" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "829" }, - "json": { - "name": "age" + { + "$ref": "840" + }, + { + "$ref": "832" + }, + { + "$ref": "835" + }, + { + "$ref": "838" + } + ], + "response": { + "type": { + "$ref": "377" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "634", - "kind": "property", - "name": "nullableText", + "$id": "841", + "kind": "basic", + "name": "noContentType", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nullableText", - "type": { - "$id": "635", - "kind": "nullable", - "type": { - "$id": "636", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, + "doc": "Return hi again", + "operation": { + "$id": "842", + "name": "noContentType", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Return hi again", + "accessibility": "public", + "parameters": [ + { + "$id": "843", + "kind": "header", + "name": "p1", + "serializedName": "p1", + "type": { + "$id": "844", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", + "methodParameterSegments": [ + { + "$id": "845", + "kind": "method", + "name": "info", + "serializedName": "info", + "type": { + "$ref": "427" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec..anonymous.info", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "846", + "kind": "method", + "name": "p1", + "serializedName": "p1", + "doc": "header parameter", + "type": { + "$ref": "429" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p1", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "847", + "kind": "path", + "name": "p2", + "serializedName": "p2", + "type": { + "$id": "848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", + "methodParameterSegments": [ + { + "$ref": "845" + }, + { + "$id": "849", + "kind": "method", + "name": "p2", + "serializedName": "p2", + "doc": "path parameter", + "type": { + "$ref": "432" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p2", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "850", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "124" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", + "methodParameterSegments": [ + { + "$id": "851", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "124" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "852", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "126" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", + "methodParameterSegments": [ + { + "$id": "853", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "126" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "854", + "kind": "body", + "name": "action", + "serializedName": "action", + "type": { + "$ref": "377" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", + "methodParameterSegments": [ + { + "$ref": "845" + }, + { + "$id": "855", + "kind": "method", + "name": "action", + "serializedName": "action", + "doc": "body parameter", + "type": { + "$ref": "377" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.action", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "action" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "377" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/noContentType/{p2}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Tree.nullableText", - "serializationOptions": { - "xml": { - "name": "nullableText", - "attribute": false, - "unwrapped": false - }, - "json": { - "name": "nullableText" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "637", - "kind": "property", - "name": "nullableLabels", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableLabels", - "type": { - "$id": "638", - "kind": "nullable", - "type": { - "$ref": "507" + "parameters": [ + { + "$ref": "845" }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Tree.nullableLabels", - "serializationOptions": { - "xml": { - "name": "nullableLabels", - "attribute": false, - "unwrapped": false + { + "$ref": "851" }, - "json": { - "name": "nullableLabels" + { + "$ref": "853" } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$ref": "624" - }, - { - "$id": "639", - "kind": "model", - "name": "GetWidgetMetricsResponse", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "640", - "kind": "property", - "name": "numSold", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" ], - "serializedName": "numSold", - "type": { - "$id": "641", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous.numSold", - "serializationOptions": { - "json": { - "name": "numSold" + "response": { + "type": { + "$ref": "377" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": true, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "642", - "kind": "property", - "name": "averagePrice", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "averagePrice", - "type": { - "$id": "643", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous.averagePrice", - "serializationOptions": { - "json": { - "name": "averagePrice" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "644", - "kind": "model", - "name": "GetNotebookResponse", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.getNotebook.Response.anonymous", - "usage": "Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "645", - "kind": "property", - "name": "name", + "$id": "856", + "kind": "basic", + "name": "helloDemo2", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "name", - "type": { - "$id": "646", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getNotebook.Response.anonymous.name", - "serializationOptions": { - "json": { - "name": "name" + "doc": "Return hi in demo2", + "operation": { + "$id": "857", + "name": "helloDemo2", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Return hi in demo2", + "accessibility": "public", + "parameters": [ + { + "$id": "858", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "128" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", + "methodParameterSegments": [ + { + "$id": "859", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "128" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/demoHi", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2", + "decorators": [], + "namespace": "SampleTypeSpec", + "experimental": { + "diagnosticId": "SAMPLE0001", + "dependsOn": [] } }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "647", - "kind": "property", - "name": "content", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" + "parameters": [ + { + "$ref": "859" + } ], - "serializedName": "content", - "type": { - "$id": "648", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getNotebook.Response.anonymous.content", - "serializationOptions": { - "json": { - "name": "content" + "response": { + "type": { + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "649", - "kind": "model", - "name": "NullableDynamicModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel", - "access": "public", - "usage": "Input,Json", - "decorators": [ - { - "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", - "arguments": {} - } - ], - "serializationOptions": { - "json": { - "name": "NullableDynamicModel" - } - }, - "isExactName": false, - "properties": [ + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" + }, { - "$id": "650", - "kind": "property", - "name": "modelValue", + "$id": "860", + "kind": "basic", + "name": "createLiteral", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "modelValue", - "type": { - "$id": "651", - "kind": "nullable", - "type": { - "$ref": "440" - }, + "doc": "Create with literal value", + "operation": { + "$id": "861", + "name": "createLiteral", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Create with literal value", + "accessibility": "public", + "parameters": [ + { + "$id": "862", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "130" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", + "methodParameterSegments": [ + { + "$id": "863", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "130" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "864", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "132" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", + "methodParameterSegments": [ + { + "$id": "865", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "132" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "866", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "342" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", + "methodParameterSegments": [ + { + "$id": "867", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "342" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/literal", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.modelValue", - "serializationOptions": { - "json": { - "name": "modelValue" + "parameters": [ + { + "$ref": "867" + }, + { + "$ref": "863" + }, + { + "$ref": "865" } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "652", - "kind": "property", - "name": "children", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" ], - "serializedName": "children", - "type": { - "$id": "653", - "kind": "nullable", + "response": { "type": { - "$id": "654", - "kind": "array", - "name": "Array2", - "valueType": { - "$id": "655", - "kind": "nullable", - "type": { - "$ref": "440" - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.children", - "serializationOptions": { - "json": { - "name": "children" + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "656", - "kind": "property", - "name": "childDictionary", + "$id": "868", + "kind": "basic", + "name": "helloLiteral", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "childDictionary", - "type": { - "$id": "657", - "kind": "nullable", - "type": { - "$id": "658", - "kind": "dict", - "keyType": { - "$id": "659", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "doc": "Send literal parameters", + "operation": { + "$id": "869", + "name": "helloLiteral", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Send literal parameters", + "accessibility": "public", + "parameters": [ + { + "$id": "870", + "kind": "header", + "name": "p1", + "serializedName": "p1", + "type": { + "$ref": "134" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", + "methodParameterSegments": [ + { + "$id": "871", + "kind": "method", + "name": "p1", + "serializedName": "p1", + "type": { + "$ref": "136" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false }, - "valueType": { - "$id": "660", - "kind": "nullable", + { + "$id": "872", + "kind": "path", + "name": "p2", + "serializedName": "p2", "type": { - "$ref": "440" + "$ref": "138" }, - "namespace": "SampleTypeSpec" + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Constant", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", + "methodParameterSegments": [ + { + "$id": "873", + "kind": "method", + "name": "p2", + "serializedName": "p2", + "type": { + "$ref": "140" + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.childDictionary", - "serializationOptions": { - "json": { - "name": "childDictionary" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "661", - "kind": "property", - "name": "nestedChildren", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nestedChildren", - "type": { - "$id": "662", - "kind": "nullable", - "type": { - "$id": "663", - "kind": "array", - "name": "Array3", - "valueType": { - "$id": "664", - "kind": "nullable", + { + "$id": "874", + "kind": "query", + "name": "p3", + "serializedName": "p3", "type": { - "$id": "665", - "kind": "array", - "name": "Array4", - "valueType": { - "$id": "666", - "kind": "nullable", + "$ref": "142" + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Constant", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "875", + "kind": "method", + "name": "p3", + "serializedName": "p3", + "type": { + "$ref": "144" + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "876", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "146" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", + "methodParameterSegments": [ + { + "$id": "877", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "440" + "$ref": "146" }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/helloLiteral/{p2}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildren", - "serializationOptions": { - "json": { - "name": "nestedChildren" + "parameters": [ + { + "$ref": "871" + }, + { + "$ref": "873" + }, + { + "$ref": "875" + }, + { + "$ref": "877" + } + ], + "response": { + "type": { + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "667", - "kind": "property", - "name": "nestedChildDictionary", + "$id": "878", + "kind": "basic", + "name": "topAction", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nestedChildDictionary", - "type": { - "$id": "668", - "kind": "nullable", - "type": { - "$id": "669", - "kind": "dict", - "keyType": { - "$id": "670", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "671", - "kind": "nullable", + "doc": "top level method", + "operation": { + "$id": "879", + "name": "topAction", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "top level method", + "accessibility": "public", + "parameters": [ + { + "$id": "880", + "kind": "path", + "name": "action", + "serializedName": "action", "type": { - "$id": "672", - "kind": "dict", - "keyType": { - "$id": "673", + "$id": "881", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "882", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "valueType": { - "$id": "674", - "kind": "nullable", - "type": { - "$ref": "440" - }, - "namespace": "SampleTypeSpec" - }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", "decorators": [] }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildDictionary", - "serializationOptions": { - "json": { - "name": "nestedChildDictionary" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "675", - "kind": "property", - "name": "dictionaryChildren", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "dictionaryChildren", - "type": { - "$id": "676", - "kind": "nullable", - "type": { - "$id": "677", - "kind": "dict", - "keyType": { - "$id": "678", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", + "methodParameterSegments": [ + { + "$id": "883", + "kind": "method", + "name": "action", + "serializedName": "action", + "type": { + "$id": "884", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "885", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false }, - "valueType": { - "$id": "679", - "kind": "nullable", + { + "$id": "886", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "680", - "kind": "array", - "name": "Array5", - "valueType": { - "$id": "681", - "kind": "nullable", + "$ref": "148" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", + "methodParameterSegments": [ + { + "$id": "887", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "440" + "$ref": "148" }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/top/{action}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.dictionaryChildren", - "serializationOptions": { - "json": { - "name": "dictionaryChildren" + "parameters": [ + { + "$ref": "883" + }, + { + "$ref": "887" + } + ], + "response": { + "type": { + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "682", - "kind": "property", - "name": "listOfDictionaries", + "$id": "888", + "kind": "basic", + "name": "topAction2", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "listOfDictionaries", - "type": { - "$id": "683", - "kind": "nullable", - "type": { - "$id": "684", - "kind": "array", - "name": "Array6", - "valueType": { - "$id": "685", - "kind": "nullable", + "doc": "top level method2", + "operation": { + "$id": "889", + "name": "topAction2", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "top level method2", + "accessibility": "public", + "parameters": [ + { + "$id": "890", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "686", - "kind": "dict", - "keyType": { - "$id": "687", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "688", - "kind": "nullable", + "$ref": "150" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", + "methodParameterSegments": [ + { + "$id": "891", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "440" + "$ref": "150" }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.listOfDictionaries", - "serializationOptions": { - "json": { - "name": "listOfDictionaries" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "689", - "kind": "model", - "name": "OptionalNullableDynamicProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableDynamicProperties", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [ - { - "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", - "arguments": {} - } - ], - "serializationOptions": { - "json": { - "name": "OptionalNullableDynamicProperties" - } - }, - "isExactName": false, - "baseModel": { - "$id": "690", - "kind": "model", - "name": "OptionalNullableBase", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableBase" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "691", - "kind": "property", - "name": "inheritedNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "inheritedNullable", - "type": { - "$id": "692", - "kind": "nullable", - "type": { - "$id": "693", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase.inheritedNullable", - "serializationOptions": { - "json": { - "name": "inheritedNullable" + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - "properties": [] - }, - { - "$ref": "690" - }, - { - "$id": "694", - "kind": "model", - "name": "OptionalNullableChild", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableChild" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "695", - "kind": "property", - "name": "value", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "value", - "type": { - "$id": "696", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/top2", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2", + "decorators": [], + "namespace": "SampleTypeSpec" }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild.value", - "serializationOptions": { - "json": { - "name": "value" + "parameters": [ + { + "$ref": "891" + } + ], + "response": { + "type": { + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "697", - "kind": "model", - "name": "OptionalNullableProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableProperties" - } - }, - "isExactName": false, - "baseModel": { - "$ref": "690" - }, - "properties": [ + "isOverride": false, + "generateConvenient": false, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" + }, { - "$id": "698", - "kind": "property", - "name": "nullableModel", + "$id": "892", + "kind": "basic", + "name": "patchAction", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nullableModel", - "type": { - "$id": "699", - "kind": "nullable", - "type": { - "$ref": "694" - }, + "doc": "top level patch", + "operation": { + "$id": "893", + "name": "patchAction", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "top level patch", + "accessibility": "public", + "parameters": [ + { + "$id": "894", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "152" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", + "methodParameterSegments": [ + { + "$id": "895", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "152" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "896", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "154" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", + "methodParameterSegments": [ + { + "$id": "897", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "154" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "898", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "342" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", + "methodParameterSegments": [ + { + "$id": "899", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "342" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "PATCH", + "uri": "{sampleTypeSpecUrl}", + "path": "/patch", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableModel", - "serializationOptions": { - "json": { - "name": "nullableModel" + "parameters": [ + { + "$ref": "899" + }, + { + "$ref": "895" + }, + { + "$ref": "897" + } + ], + "response": { + "type": { + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "700", - "kind": "property", - "name": "nullableString", + "$id": "900", + "kind": "basic", + "name": "anonymousBody", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "nullableString", - "type": { - "$id": "701", - "kind": "nullable", - "type": { - "$id": "702", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, + "doc": "body parameter without body decorator", + "operation": { + "$id": "901", + "name": "anonymousBody", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "body parameter without body decorator", + "accessibility": "public", + "parameters": [ + { + "$id": "902", + "kind": "query", + "name": "requiredQueryParam", + "serializedName": "requiredQueryParam", + "type": { + "$ref": "156" + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Constant", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "903", + "kind": "method", + "name": "requiredQueryParam", + "serializedName": "requiredQueryParam", + "type": { + "$ref": "158" + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "904", + "kind": "header", + "name": "requiredHeader", + "serializedName": "required-header", + "type": { + "$ref": "160" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", + "methodParameterSegments": [ + { + "$id": "905", + "kind": "method", + "name": "requiredHeader", + "serializedName": "required-header", + "type": { + "$ref": "162" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "906", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "164" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", + "methodParameterSegments": [ + { + "$id": "907", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "164" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "908", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "166" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", + "methodParameterSegments": [ + { + "$id": "909", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "166" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "910", + "kind": "body", + "name": "thing", + "serializedName": "thing", + "type": { + "$ref": "342" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Spread", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", + "methodParameterSegments": [ + { + "$id": "911", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "name of the Thing", + "type": { + "$id": "912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.name", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/anonymousBody", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableString", - "serializationOptions": { - "json": { - "name": "nullableString" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "703", - "kind": "property", - "name": "nullableInt", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableInt", - "type": { - "$id": "704", - "kind": "nullable", - "type": { - "$id": "705", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] + "parameters": [ + { + "$ref": "911" }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableInt", - "serializationOptions": { - "json": { - "name": "nullableInt" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "706", - "kind": "property", - "name": "nullableBoolean", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableBoolean", - "type": { - "$id": "707", - "kind": "nullable", - "type": { - "$id": "708", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] + { + "$id": "913", + "kind": "method", + "name": "requiredUnion", + "serializedName": "requiredUnion", + "doc": "required Union", + "type": { + "$ref": "346" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredUnion", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBoolean", - "serializationOptions": { - "json": { - "name": "nullableBoolean" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "709", - "kind": "property", - "name": "nullableEnum", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableEnum", - "type": { - "$id": "710", - "kind": "nullable", - "type": { - "$ref": "17" + { + "$id": "914", + "kind": "method", + "name": "requiredLiteralString", + "serializedName": "requiredLiteralString", + "doc": "required literal string", + "type": { + "$ref": "100" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableEnum", - "serializationOptions": { - "json": { - "name": "nullableEnum" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "711", - "kind": "property", - "name": "nullableDateTime", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableDateTime", - "type": { - "$id": "712", - "kind": "nullable", - "type": { - "$id": "713", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "714", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + { + "$id": "915", + "kind": "method", + "name": "requiredNullableString", + "serializedName": "requiredNullableString", + "doc": "required nullable string", + "type": { + "$ref": "353" }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDateTime", - "serializationOptions": { - "json": { - "name": "nullableDateTime" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "715", - "kind": "property", - "name": "nullableBytes", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableBytes", - "type": { - "$id": "716", - "kind": "nullable", - "type": { - "$id": "717", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] + { + "$id": "916", + "kind": "method", + "name": "optionalNullableString", + "serializedName": "optionalNullableString", + "doc": "required optional string", + "type": { + "$ref": "356" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "917", + "kind": "method", + "name": "requiredLiteralInt", + "serializedName": "requiredLiteralInt", + "doc": "required literal int", + "type": { + "$ref": "102" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralInt", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "918", + "kind": "method", + "name": "requiredLiteralFloat", + "serializedName": "requiredLiteralFloat", + "doc": "required literal float", + "type": { + "$ref": "104" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralFloat", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBytes", - "serializationOptions": { - "json": { - "name": "nullableBytes" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "718", - "kind": "property", - "name": "nullableList", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableList", - "type": { - "$id": "719", - "kind": "nullable", - "type": { - "$id": "720", - "kind": "array", - "name": "Array7", - "valueType": { - "$id": "721", - "kind": "nullable", - "type": { - "$id": "722", + { + "$id": "919", + "kind": "method", + "name": "requiredLiteralBool", + "serializedName": "requiredLiteralBool", + "doc": "required literal bool", + "type": { + "$ref": "106" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralBool", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "920", + "kind": "method", + "name": "optionalLiteralString", + "serializedName": "optionalLiteralString", + "doc": "optional literal string", + "type": { + "$id": "921", + "kind": "enum", + "name": "ThingOptionalLiteralString", + "apiVersions": [], + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "922", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "namespace": "SampleTypeSpec" + "values": [ + { + "$id": "923", + "kind": "enumvalue", + "name": "reject", + "value": "reject", + "valueType": { + "$id": "924", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "enumType": { + "$ref": "921" + }, + "decorators": [], + "isExactName": false + } + ], + "namespace": "SampleTypeSpec", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [], + "isExactName": false }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableList", - "serializationOptions": { - "json": { - "name": "nullableList" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "723", - "kind": "property", - "name": "nullableDictionary", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableDictionary", - "type": { - "$id": "724", - "kind": "nullable", - "type": { - "$id": "725", - "kind": "dict", - "keyType": { - "$id": "726", + { + "$id": "925", + "kind": "method", + "name": "requiredNullableLiteralString", + "serializedName": "requiredNullableLiteralString", + "doc": "required nullable literal string", + "type": { + "$ref": "363" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableLiteralString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "926", + "kind": "method", + "name": "optionalLiteralInt", + "serializedName": "optionalLiteralInt", + "doc": "optional literal int", + "type": { + "$id": "927", + "kind": "enum", + "name": "ThingOptionalLiteralInt", + "apiVersions": [], + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "928", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "values": [ + { + "$id": "929", + "kind": "enumvalue", + "name": "456", + "value": 456, + "valueType": { + "$id": "930", + "kind": "int32", + "decorators": [], + "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32" + }, + "enumType": { + "$ref": "927" + }, + "decorators": [], + "isExactName": false + } + ], + "namespace": "SampleTypeSpec", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [], + "isExactName": false + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralInt", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "931", + "kind": "method", + "name": "optionalLiteralFloat", + "serializedName": "optionalLiteralFloat", + "doc": "optional literal float", + "type": { + "$id": "932", + "kind": "enum", + "name": "ThingOptionalLiteralFloat", + "apiVersions": [], + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "933", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "values": [ + { + "$id": "934", + "kind": "enumvalue", + "name": "4.56", + "value": 4.56, + "valueType": { + "$id": "935", + "kind": "float32", + "decorators": [], + "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32" + }, + "enumType": { + "$ref": "932" + }, + "decorators": [], + "isExactName": false + } + ], + "namespace": "SampleTypeSpec", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [], + "isExactName": false + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralFloat", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "936", + "kind": "method", + "name": "optionalLiteralBool", + "serializedName": "optionalLiteralBool", + "doc": "optional literal bool", + "type": { + "$ref": "108" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralBool", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "937", + "kind": "method", + "name": "requiredBadDescription", + "serializedName": "requiredBadDescription", + "doc": "description with xml <|endoftext|>", + "type": { + "$id": "938", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "valueType": { - "$id": "727", - "kind": "nullable", - "type": { - "$id": "728", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDictionary", - "serializationOptions": { - "json": { - "name": "nullableDictionary" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "729", - "kind": "property", - "name": "readOnlyNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "readOnlyNullable", - "type": { - "$id": "730", - "kind": "nullable", - "type": { - "$id": "731", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredBadDescription", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.readOnlyNullable", - "serializationOptions": { - "json": { - "name": "readOnlyNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "732", - "kind": "property", - "name": "requiredNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "requiredNullable", - "type": { - "$id": "733", - "kind": "nullable", - "type": { - "$id": "734", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + { + "$id": "939", + "kind": "method", + "name": "optionalNullableList", + "serializedName": "optionalNullableList", + "doc": "optional nullable collection", + "type": { + "$ref": "370" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableList", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false }, - "namespace": "SampleTypeSpec" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.requiredNullable", - "serializationOptions": { - "json": { - "name": "requiredNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "735", - "kind": "property", - "name": "optionalNonNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalNonNullable", - "type": { - "$id": "736", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullable", - "serializationOptions": { - "json": { - "name": "optionalNonNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "737", - "kind": "property", - "name": "optionalNonNullableInt", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalNonNullableInt", - "type": { - "$id": "738", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullableInt", - "serializationOptions": { - "json": { - "name": "optionalNonNullableInt" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "739", - "kind": "model", - "name": "OptionalNullableContainer", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableContainer" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "740", - "kind": "property", - "name": "child", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "child", - "type": { - "$ref": "697" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer.child", - "serializationOptions": { - "json": { - "name": "child" + { + "$id": "940", + "kind": "method", + "name": "requiredNullableList", + "serializedName": "requiredNullableList", + "doc": "required nullable collection", + "type": { + "$ref": "374" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableList", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "941", + "kind": "method", + "name": "propertyWithSpecialDocs", + "serializedName": "propertyWithSpecialDocs", + "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", + "type": { + "$id": "942", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.propertyWithSpecialDocs", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$ref": "903" + }, + { + "$ref": "905" + }, + { + "$ref": "907" + }, + { + "$ref": "909" } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "741", - "kind": "model", - "name": "OptionalNullableFieldNames", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableFieldNames" - } - }, - "isExactName": false, - "additionalProperties": { - "$id": "742", - "kind": "nullable", - "type": { - "$id": "743", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "properties": [ - { - "$id": "744", - "kind": "property", - "name": "additionalStringProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" ], - "serializedName": "additionalStringProperties", - "type": { - "$id": "745", - "kind": "nullable", + "response": { "type": { - "$id": "746", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringProperties", - "serializationOptions": { - "json": { - "name": "additionalStringProperties" + "$ref": "342" } }, - "isHttpMetadata": false, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "747", - "kind": "property", - "name": "additionalStringPropertiesIsDefined", + "$id": "943", + "kind": "basic", + "name": "friendlyModel", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "serializedName": "additionalStringPropertiesIsDefined", - "type": { - "$id": "748", - "kind": "nullable", - "type": { - "$id": "749", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, + "doc": "Model can have its friendly name", + "operation": { + "$id": "944", + "name": "friendlyModel", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Model can have its friendly name", + "accessibility": "public", + "parameters": [ + { + "$id": "945", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "178" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", + "methodParameterSegments": [ + { + "$id": "946", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "178" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "947", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "180" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", + "methodParameterSegments": [ + { + "$id": "948", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "180" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "949", + "kind": "body", + "name": "friend", + "serializedName": "friend", + "type": { + "$ref": "433" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Spread", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", + "methodParameterSegments": [ + { + "$id": "950", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "name of the NotFriend", + "type": { + "$id": "951", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.name", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "433" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/friendlyName", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel", + "decorators": [], "namespace": "SampleTypeSpec" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringPropertiesIsDefined", - "serializationOptions": { - "json": { - "name": "additionalStringPropertiesIsDefined" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "750", - "kind": "model", - "name": "UnionAdditionalProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.UnionAdditionalProperties", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "UnionAdditionalProperties" - } - }, - "isExactName": false, - "additionalProperties": { - "$id": "751", - "kind": "nullable", - "type": { - "$id": "752", - "kind": "union", - "name": "UnionAdditionalPropertiesAdditionalProperty", - "variantTypes": [ + "parameters": [ { - "$id": "753", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "950" }, { - "$id": "754", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] + "$ref": "946" }, { - "$id": "755", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] + "$ref": "948" } ], - "namespace": "SampleTypeSpec", - "decorators": [], - "isExactName": false - }, - "namespace": "SampleTypeSpec" - }, - "properties": [] - }, - { - "$id": "756", - "kind": "model", - "name": "JsonlStreamStreamingItem", - "apiVersions": [], - "namespace": "TypeSpec.Http.Streams", - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream", - "usage": "None", - "doc": "", - "decorators": [], - "serializationOptions": {}, - "isExactName": false, - "properties": [ - { - "$id": "757", - "kind": "property", - "name": "contentType", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "type": { - "$ref": "226" + "response": { + "type": { + "$ref": "433" + } }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", - "serializationOptions": {}, - "isHttpMetadata": true, - "isExactName": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "758", - "kind": "property", - "name": "body", + "$id": "952", + "kind": "basic", + "name": "addTimeHeader", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "type": { - "$id": "759", - "kind": "bytes", - "name": "bytes", - "crossLanguageDefinitionId": "", - "decorators": [] + "operation": { + "$id": "953", + "name": "addTimeHeader", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "954", + "kind": "header", + "name": "repeatabilityFirstSent", + "serializedName": "Repeatability-First-Sent", + "type": { + "$id": "955", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "956", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "isApiVersion": false, + "optional": true, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", + "methodParameterSegments": [ + { + "$id": "957", + "kind": "method", + "name": "repeatabilityFirstSent", + "serializedName": "Repeatability-First-Sent", + "type": { + "$id": "958", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "959", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader", + "decorators": [], + "namespace": "SampleTypeSpec" }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", - "serializationOptions": {}, - "isHttpMetadata": false, - "isExactName": false - } - ] - } - ], - "clients": [ - { - "$id": "760", - "kind": "client", - "name": "SampleTypeSpecClient", - "isExactName": false, - "namespace": "SampleTypeSpec", - "doc": "This is a sample typespec project.", - "methods": [ + "parameters": [ + { + "$ref": "957" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" + }, { - "$id": "761", + "$id": "960", "kind": "basic", - "name": "sayHi", + "name": "projectedNameModel", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Return hi", + "doc": "Model can have its projected name", "operation": { - "$id": "762", - "name": "sayHi", + "$id": "961", + "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Return hi", + "doc": "Model can have its projected name", "accessibility": "public", "parameters": [ { - "$id": "763", + "$id": "962", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "182" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", + "methodParameterSegments": [ + { + "$id": "963", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "182" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "964", "kind": "header", - "name": "headParameter", - "serializedName": "head-parameter", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "764", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "184" }, "isApiVersion": false, "optional": false, "isContentType": false, - "scope": "Method", + "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "765", + "$id": "965", "kind": "method", - "name": "headParameter", - "serializedName": "head-parameter", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "766", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "184" }, "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -10871,87 +14159,158 @@ "isExactName": false }, { - "$id": "767", - "kind": "query", - "name": "queryParameter", - "serializedName": "queryParameter", + "$id": "966", + "kind": "body", + "name": "renamedModel", + "serializedName": "renamedModel", "type": { - "$id": "768", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "436" }, "isApiVersion": false, - "explode": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", "optional": false, - "scope": "Method", + "scope": "Spread", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "769", + "$id": "967", "kind": "method", - "name": "queryParameter", - "serializedName": "queryParameter", + "name": "otherName", + "serializedName": "otherName", + "doc": "name of the ModelWithClientName", "type": { - "$id": "770", + "$id": "968", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "location": "Query", + "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.otherName", "readOnly": false, "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false - }, + "isExactName": false, + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "responses": [ { - "$id": "771", - "kind": "query", - "name": "optionalQuery", - "serializedName": "optionalQuery", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "436" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/projectedName", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "967" + }, + { + "$ref": "963" + }, + { + "$ref": "965" + } + ], + "response": { + "type": { + "$ref": "436" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" + }, + { + "$id": "969", + "kind": "basic", + "name": "returnsAnonymousModel", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "return anonymous model", + "operation": { + "$id": "970", + "name": "returnsAnonymousModel", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "return anonymous model", + "accessibility": "public", + "parameters": [ + { + "$id": "971", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "772", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "186" }, "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", + "optional": false, + "isContentType": false, + "scope": "Constant", "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "773", + "$id": "972", "kind": "method", - "name": "optionalQuery", - "serializedName": "optionalQuery", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "774", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "186" }, - "location": "Query", + "location": "Header", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -10959,14 +14318,79 @@ } ], "isExactName": false - }, + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "439" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/returnsAnonymousModel", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "972" + } + ], + "response": { + "type": { + "$ref": "439" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" + }, + { + "$id": "973", + "kind": "basic", + "name": "getUnknownValue", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "get extensible enum", + "operation": { + "$id": "974", + "name": "getUnknownValue", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "get extensible enum", + "accessibility": "public", + "parameters": [ { - "$id": "775", + "$id": "975", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "116" + "$ref": "188" }, "isApiVersion": false, "optional": false, @@ -10974,21 +14398,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "methodParameterSegments": [ { - "$id": "776", + "$id": "976", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "116" + "$ref": "188" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "readOnly": false, "access": "public", "decorators": [], @@ -11004,110 +14428,91 @@ 200 ], "bodyType": { - "$ref": "294" + "$ref": "87" }, "headers": [], "isErrorResponse": false, "contentTypes": [ - "application/json" + "text/plain" ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/hello", + "path": "/unknown-value", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi", + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "765" - }, - { - "$ref": "769" - }, - { - "$ref": "773" - }, - { - "$ref": "776" + "$ref": "976" } ], "response": { "type": { - "$ref": "294" + "$ref": "87" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "777", + "$id": "977", "kind": "basic", - "name": "helloAgain", + "name": "internalProtocol", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Return hi again", + "doc": "When set protocol false and convenient true, then the protocol method should be internal", "operation": { - "$id": "778", - "name": "helloAgain", + "$id": "978", + "name": "internalProtocol", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Return hi again", + "doc": "When set protocol false and convenient true, then the protocol method should be internal", "accessibility": "public", "parameters": [ { - "$id": "779", + "$id": "979", "kind": "header", - "name": "p1", - "serializedName": "p1", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "780", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "190" }, "isApiVersion": false, "optional": false, - "isContentType": false, - "scope": "Method", + "isContentType": true, + "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "methodParameterSegments": [ { - "$id": "781", + "$id": "980", "kind": "method", - "name": "p1", - "serializedName": "p1", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "782", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "190" }, "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -11117,34 +14522,34 @@ "isExactName": false }, { - "$id": "783", + "$id": "981", "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "118" + "$ref": "192" }, "isApiVersion": false, "optional": false, - "isContentType": true, + "isContentType": false, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "784", + "$id": "982", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "118" + "$ref": "192" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "readOnly": false, "access": "public", "decorators": [], @@ -11154,12 +14559,177 @@ "isExactName": false }, { - "$id": "785", + "$id": "983", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "342" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", + "methodParameterSegments": [ + { + "$id": "984", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "342" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "342" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/internalProtocol", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": false, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "984" + }, + { + "$ref": "980" + }, + { + "$ref": "982" + } + ], + "response": { + "type": { + "$ref": "342" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": false, + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" + }, + { + "$id": "985", + "kind": "basic", + "name": "stillConvenient", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", + "operation": { + "$id": "986", + "name": "stillConvenient", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", + "accessibility": "public", + "parameters": [], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/stillConvenient", + "bufferResponse": true, + "generateProtocolMethod": false, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": false, + "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" + }, + { + "$id": "987", + "kind": "basic", + "name": "headAsBoolean", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "head as boolean.", + "operation": { + "$id": "988", + "name": "headAsBoolean", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "head as boolean.", + "accessibility": "public", + "parameters": [ + { + "$id": "989", "kind": "path", - "name": "p2", - "serializedName": "p2", + "name": "id", + "serializedName": "id", "type": { - "$id": "786", + "$id": "990", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11174,15 +14744,15 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "787", + "$id": "991", "kind": "method", - "name": "p2", - "serializedName": "p2", + "name": "id", + "serializedName": "id", "type": { - "$id": "788", + "$id": "992", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11192,44 +14762,7 @@ "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "789", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "122" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", - "methodParameterSegments": [ - { - "$id": "790", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "122" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "readOnly": false, "access": "public", "decorators": [], @@ -11237,113 +14770,43 @@ } ], "isExactName": false - }, - { - "$id": "791", - "kind": "body", - "name": "action", - "serializedName": "action", - "type": { - "$ref": "329" - }, - "isApiVersion": false, - "contentTypes": [ - "text/plain" - ], - "defaultContentType": "text/plain", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", - "methodParameterSegments": [ - { - "$id": "792", - "kind": "method", - "name": "action", - "serializedName": "action", - "type": { - "$ref": "329" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": {} } ], "responses": [ { "statusCodes": [ - 200 + 204 ], - "bodyType": { - "$ref": "329" - }, "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], - "httpMethod": "GET", + "httpMethod": "HEAD", "uri": "{sampleTypeSpecUrl}", - "path": "/againHi/{p2}", - "requestMediaTypes": [ - "text/plain" - ], + "path": "/headAsBoolean/{id}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain", + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "781" - }, - { - "$ref": "792" - }, - { - "$ref": "784" - }, - { - "$ref": "787" - }, - { - "$ref": "790" + "$ref": "991" } ], - "response": { - "type": { - "$ref": "329" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" }, { - "$id": "793", + "$id": "993", "kind": "basic", - "name": "noContentType", + "name": "WithApiVersion", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -11352,20 +14815,20 @@ ], "doc": "Return hi again", "operation": { - "$id": "794", - "name": "noContentType", + "$id": "994", + "name": "WithApiVersion", "isExactName": false, "resourceName": "SampleTypeSpec", "doc": "Return hi again", "accessibility": "public", "parameters": [ { - "$id": "795", + "$id": "995", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "796", + "$id": "996", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11377,40 +14840,25 @@ "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "methodParameterSegments": [ { - "$id": "797", - "kind": "method", - "name": "info", - "serializedName": "info", - "type": { - "$ref": "379" - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec..anonymous.info", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "798", + "$id": "997", "kind": "method", "name": "p1", "serializedName": "p1", - "doc": "header parameter", "type": { - "$ref": "381" + "$id": "998", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "", + "location": "Header", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p1", + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "readOnly": false, "access": "public", "decorators": [], @@ -11420,45 +14868,60 @@ "isExactName": false }, { - "$id": "799", - "kind": "path", - "name": "p2", - "serializedName": "p2", + "$id": "999", + "kind": "query", + "name": "apiVersion", + "serializedName": "apiVersion", "type": { - "$id": "800", + "$id": "1000", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "isApiVersion": false, + "isApiVersion": true, "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, + "defaultValue": { + "type": { + "$id": "1001", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-08-16-preview" + }, "optional": false, - "scope": "Method", + "scope": "Client", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", "methodParameterSegments": [ { - "$ref": "797" - }, - { - "$id": "801", + "$id": "1002", "kind": "method", - "name": "p2", - "serializedName": "p2", - "doc": "path parameter", + "name": "apiVersion", + "serializedName": "apiVersion", "type": { - "$ref": "384" + "$id": "1003", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "location": "", - "isApiVersion": false, - "optional": false, + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1004", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-08-16-preview" + }, + "optional": true, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p2", + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", "readOnly": false, "access": "public", "decorators": [], @@ -11466,53 +14929,65 @@ } ], "isExactName": false - }, + } + ], + "responses": [ { - "$id": "802", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "124" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", - "methodParameterSegments": [ - { - "$id": "803", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "124" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } + "statusCodes": [ + 204 ], - "isExactName": false - }, + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/WithApiVersion", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "997" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" + }, + { + "$id": "1005", + "kind": "paging", + "name": "ListWithNextLink", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "List things with nextlink", + "operation": { + "$id": "1006", + "name": "ListWithNextLink", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with nextlink", + "accessibility": "public", + "parameters": [ { - "$id": "804", + "$id": "1007", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "126" + "$ref": "194" }, "isApiVersion": false, "optional": false, @@ -11520,21 +14995,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "methodParameterSegments": [ { - "$id": "805", + "$id": "1008", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "126" + "$ref": "194" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "readOnly": false, "access": "public", "decorators": [], @@ -11542,55 +15017,6 @@ } ], "isExactName": false - }, - { - "$id": "806", - "kind": "body", - "name": "action", - "serializedName": "action", - "type": { - "$ref": "329" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", - "methodParameterSegments": [ - { - "$ref": "797" - }, - { - "$id": "807", - "kind": "method", - "name": "action", - "serializedName": "action", - "doc": "body parameter", - "type": { - "$ref": "329" - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.action", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "action" - } - } } ], "responses": [ @@ -11599,7 +15025,7 @@ 200 ], "bodyType": { - "$ref": "329" + "$ref": "440" }, "headers": [], "isErrorResponse": false, @@ -11615,64 +15041,71 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/noContentType/{p2}", - "requestMediaTypes": [ - "application/json" - ], + "path": "/link", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "797" - }, - { - "$ref": "803" - }, - { - "$ref": "805" + "$ref": "1008" } ], "response": { "type": { - "$ref": "329" - } + "$ref": "442" + }, + "resultSegments": [ + "things" + ] }, - "isOverride": true, + "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "nextLink": { + "verb": "GET", + "responseSegments": [ + "next" + ], + "responseLocation": "Body" + }, + "pageSizeParameterSegments": [] + } }, { - "$id": "808", - "kind": "basic", - "name": "helloDemo2", + "$id": "1009", + "kind": "paging", + "name": "ListWithStringNextLink", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Return hi in demo2", + "doc": "List things with nextlink", "operation": { - "$id": "809", - "name": "helloDemo2", + "$id": "1010", + "name": "ListWithStringNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Return hi in demo2", + "doc": "List things with nextlink", "accessibility": "public", "parameters": [ { - "$id": "810", + "$id": "1011", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "128" + "$ref": "196" }, "isApiVersion": false, "optional": false, @@ -11680,21 +15113,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "methodParameterSegments": [ { - "$id": "811", + "$id": "1012", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "128" + "$ref": "196" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "readOnly": false, "access": "public", "decorators": [], @@ -11710,7 +15143,7 @@ 200 ], "bodyType": { - "$ref": "294" + "$ref": "445" }, "headers": [], "isErrorResponse": false, @@ -11726,83 +15159,101 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/demoHi", + "path": "/linkString", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", "decorators": [], - "namespace": "SampleTypeSpec", - "experimental": { - "diagnosticId": "SAMPLE0001", - "dependsOn": [] - } + "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "811" + "$ref": "1012" } ], "response": { "type": { - "$ref": "294" - } + "$ref": "442" + }, + "resultSegments": [ + "things" + ] }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "nextLink": { + "verb": "GET", + "responseSegments": [ + "next" + ], + "responseLocation": "Body" + }, + "pageSizeParameterSegments": [] + } }, { - "$id": "812", - "kind": "basic", - "name": "createLiteral", + "$id": "1013", + "kind": "paging", + "name": "ListWithContinuationToken", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Create with literal value", + "doc": "List things with continuation token", "operation": { - "$id": "813", - "name": "createLiteral", + "$id": "1014", + "name": "ListWithContinuationToken", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Create with literal value", + "doc": "List things with continuation token", "accessibility": "public", "parameters": [ { - "$id": "814", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "1015", + "kind": "query", + "name": "token", + "serializedName": "token", "type": { - "$ref": "130" + "$id": "1016", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, + "explode": false, + "optional": true, + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", + "readOnly": false, "methodParameterSegments": [ { - "$id": "815", + "$id": "1017", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "token", + "serializedName": "token", "type": { - "$ref": "130" + "$id": "1018", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Header", + "location": "Query", "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", "readOnly": false, "access": "public", "decorators": [], @@ -11812,86 +15263,41 @@ "isExactName": false }, { - "$id": "816", + "$id": "1019", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "132" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", - "methodParameterSegments": [ - { - "$id": "817", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "132" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "818", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "294" + "$ref": "198" }, "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, - "scope": "Method", - "decorators": [], + "isContentType": false, + "scope": "Constant", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "methodParameterSegments": [ { - "$id": "819", + "$id": "1020", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "294" + "$ref": "198" }, - "location": "Body", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "readOnly": false, "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } + "isExactName": false } ], "responses": [ @@ -11900,7 +15306,7 @@ 200 ], "bodyType": { - "$ref": "294" + "$ref": "449" }, "headers": [], "isErrorResponse": false, @@ -11914,88 +15320,108 @@ } } ], - "httpMethod": "POST", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/literal", - "requestMediaTypes": [ - "application/json" - ], + "path": "/continuation", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "819" - }, - { - "$ref": "815" + "$ref": "1017" }, { - "$ref": "817" + "$ref": "1020" } ], "response": { "type": { - "$ref": "294" - } + "$ref": "442" + }, + "resultSegments": [ + "things" + ] }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "continuationToken": { + "parameter": { + "$ref": "1015" + }, + "responseSegments": [ + "nextToken" + ], + "responseLocation": "Body" + }, + "pageSizeParameterSegments": [] + } }, { - "$id": "820", - "kind": "basic", - "name": "helloLiteral", + "$id": "1021", + "kind": "paging", + "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Send literal parameters", + "doc": "List things with continuation token header response", "operation": { - "$id": "821", - "name": "helloLiteral", + "$id": "1022", + "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Send literal parameters", + "doc": "List things with continuation token header response", "accessibility": "public", "parameters": [ { - "$id": "822", - "kind": "header", - "name": "p1", - "serializedName": "p1", + "$id": "1023", + "kind": "query", + "name": "token", + "serializedName": "token", "type": { - "$ref": "134" + "$id": "1024", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, + "explode": false, + "optional": true, + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", + "readOnly": false, "methodParameterSegments": [ { - "$id": "823", + "$id": "1025", "kind": "method", - "name": "p1", - "serializedName": "p1", + "name": "token", + "serializedName": "token", "type": { - "$ref": "136" + "$id": "1026", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Header", + "location": "Query", "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", "readOnly": false, "access": "public", "decorators": [], @@ -12005,37 +15431,34 @@ "isExactName": false }, { - "$id": "824", - "kind": "path", - "name": "p2", - "serializedName": "p2", + "$id": "1027", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "138" + "$ref": "200" }, "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, "optional": false, + "isContentType": false, "scope": "Constant", - "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "methodParameterSegments": [ { - "$id": "825", + "$id": "1028", "kind": "method", - "name": "p2", - "serializedName": "p2", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "140" + "$ref": "200" }, - "location": "Path", + "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "readOnly": false, "access": "public", "decorators": [], @@ -12043,51 +15466,112 @@ } ], "isExactName": false - }, + } + ], + "responses": [ { - "$id": "826", - "kind": "query", - "name": "p3", - "serializedName": "p3", - "type": { - "$ref": "142" + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "453" }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Constant", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", - "readOnly": false, - "methodParameterSegments": [ + "headers": [ { - "$id": "827", - "kind": "method", - "name": "p3", - "serializedName": "p3", + "name": "nextToken", + "nameInResponse": "next-token", "type": { - "$ref": "144" - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "$id": "1029", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } } ], - "isExactName": false + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/continuation/header", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1025" + }, + { + "$ref": "1028" + } + ], + "response": { + "type": { + "$ref": "442" + }, + "resultSegments": [ + "things" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "continuationToken": { + "parameter": { + "$ref": "1023" }, + "responseSegments": [ + "next-token" + ], + "responseLocation": "Header" + }, + "pageSizeParameterSegments": [] + } + }, + { + "$id": "1030", + "kind": "paging", + "name": "ListWithPaging", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "List things with paging", + "operation": { + "$id": "1031", + "name": "ListWithPaging", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with paging", + "accessibility": "public", + "parameters": [ { - "$id": "828", + "$id": "1032", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "146" + "$ref": "202" }, "isApiVersion": false, "optional": false, @@ -12095,21 +15579,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "methodParameterSegments": [ { - "$id": "829", + "$id": "1033", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "146" + "$ref": "202" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "readOnly": false, "access": "public", "decorators": [], @@ -12125,7 +15609,7 @@ 200 ], "bodyType": { - "$ref": "294" + "$ref": "455" }, "headers": [], "isErrorResponse": false, @@ -12141,113 +15625,110 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/helloLiteral/{p2}", + "path": "/list/paging", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "823" - }, - { - "$ref": "825" - }, - { - "$ref": "827" - }, - { - "$ref": "829" + "$ref": "1033" } ], "response": { "type": { - "$ref": "294" - } + "$ref": "442" + }, + "resultSegments": [ + "items" + ] }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", + "pagingMetadata": { + "itemPropertySegments": [ + "items" + ], + "pageSizeParameterSegments": [] + } }, { - "$id": "830", + "$id": "1034", "kind": "basic", - "name": "topAction", + "name": "EmbeddedParameters", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "top level method", + "doc": "An operation with embedded parameters within the body", "operation": { - "$id": "831", - "name": "topAction", + "$id": "1035", + "name": "EmbeddedParameters", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "top level method", + "doc": "An operation with embedded parameters within the body", "accessibility": "public", "parameters": [ { - "$id": "832", - "kind": "path", - "name": "action", - "serializedName": "action", + "$id": "1036", + "kind": "header", + "name": "requiredHeader", + "serializedName": "required-header", + "doc": "required header parameter", "type": { - "$id": "833", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "834", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "$id": "1037", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, "optional": false, + "isContentType": false, "scope": "Method", - "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "methodParameterSegments": [ { - "$id": "835", + "$id": "1038", "kind": "method", - "name": "action", - "serializedName": "action", + "name": "body", + "serializedName": "body", "type": { - "$id": "836", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "837", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] + "$ref": "457" }, - "location": "Path", + "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "1039", + "kind": "method", + "name": "requiredHeader", + "serializedName": "requiredHeader", + "doc": "required header parameter", + "type": { + "$ref": "461" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "readOnly": false, "access": "public", "decorators": [], @@ -12257,34 +15738,43 @@ "isExactName": false }, { - "$id": "838", + "$id": "1040", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "optionalHeader", + "serializedName": "optional-header", + "doc": "optional header parameter", "type": { - "$ref": "148" + "$id": "1041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, - "optional": false, + "optional": true, "isContentType": false, - "scope": "Constant", + "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "methodParameterSegments": [ { - "$id": "839", + "$ref": "1038" + }, + { + "$id": "1042", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "optionalHeader", + "serializedName": "optionalHeader", + "doc": "optional header parameter", "type": { - "$ref": "148" + "$ref": "463" }, - "location": "Header", + "location": "", "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "readOnly": false, "access": "public", "decorators": [], @@ -12292,104 +15782,130 @@ } ], "isExactName": false - } - ], - "responses": [ + }, { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "294" + "$id": "1043", + "kind": "query", + "name": "requiredQuery", + "serializedName": "requiredQuery", + "doc": "required query parameter", + "type": { + "$id": "1044", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "1038" + }, + { + "$id": "1045", + "kind": "method", + "name": "requiredQuery", + "serializedName": "requiredQuery", + "doc": "required query parameter", + "type": { + "$ref": "465" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/top/{action}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "835" - }, - { - "$ref": "839" - } - ], - "response": { - "type": { - "$ref": "294" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction" - }, - { - "$id": "840", - "kind": "basic", - "name": "topAction2", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "top level method2", - "operation": { - "$id": "841", - "name": "topAction2", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "top level method2", - "accessibility": "public", - "parameters": [ + ], + "isExactName": false + }, + { + "$id": "1046", + "kind": "query", + "name": "optionalQuery", + "serializedName": "optionalQuery", + "doc": "optional query parameter", + "type": { + "$id": "1047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "1038" + }, + { + "$id": "1048", + "kind": "method", + "name": "optionalQuery", + "serializedName": "optionalQuery", + "doc": "optional query parameter", + "type": { + "$ref": "467" + }, + "location": "", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "842", + "$id": "1049", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "150" + "$ref": "204" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "methodParameterSegments": [ { - "$id": "843", + "$id": "1050", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "150" + "$ref": "204" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -12397,80 +15913,102 @@ } ], "isExactName": false - } - ], - "responses": [ + }, { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "294" + "$id": "1051", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "457" }, - "headers": [], - "isErrorResponse": false, + "isApiVersion": false, "contentTypes": [ "application/json" ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", + "methodParameterSegments": [ + { + "$ref": "1038" + } + ], + "isExactName": false, "serializationOptions": { "json": { - "name": "" + "name": "body" } } } ], - "httpMethod": "GET", + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/top2", + "path": "/embeddedParameters", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, - "generateConvenienceMethod": false, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2", + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "843" + "$ref": "1038" + }, + { + "$ref": "1050" } ], - "response": { - "type": { - "$ref": "294" - } - }, + "response": {}, "isOverride": false, - "generateConvenient": false, + "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" }, { - "$id": "844", + "$id": "1052", "kind": "basic", - "name": "patchAction", + "name": "DynamicModelOperation", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "top level patch", + "doc": "An operation with a dynamic model", "operation": { - "$id": "845", - "name": "patchAction", + "$id": "1053", + "name": "DynamicModelOperation", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "top level patch", + "doc": "An operation with a dynamic model", "accessibility": "public", "parameters": [ { - "$id": "846", + "$id": "1054", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "152" + "$ref": "206" }, "isApiVersion": false, "optional": false, @@ -12478,59 +16016,22 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "methodParameterSegments": [ { - "$id": "847", + "$id": "1055", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "152" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "848", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "154" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", - "methodParameterSegments": [ - { - "$id": "849", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "154" + "$ref": "206" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -12540,12 +16041,12 @@ "isExactName": false }, { - "$id": "850", + "$id": "1056", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "294" + "$ref": "468" }, "isApiVersion": false, "contentTypes": [ @@ -12556,21 +16057,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "methodParameterSegments": [ { - "$id": "851", + "$id": "1057", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "294" + "$ref": "468" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "readOnly": false, "access": "public", "decorators": [], @@ -12588,120 +16089,72 @@ "responses": [ { "statusCodes": [ - 200 + 204 ], - "bodyType": { - "$ref": "294" - }, "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], - "httpMethod": "PATCH", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/patch", + "path": "/dynamicModel", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, - "generateConvenienceMethod": false, - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction", + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation", "decorators": [], - "namespace": "SampleTypeSpec" + "namespace": "SampleTypeSpec", + "experimental": { + "diagnosticId": "SAMPLE0002", + "dependsOn": [ + "SCME0001" + ] + } }, "parameters": [ { - "$ref": "851" - }, - { - "$ref": "847" + "$ref": "1057" }, { - "$ref": "849" + "$ref": "1055" } ], - "response": { - "type": { - "$ref": "294" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" }, { - "$id": "852", + "$id": "1058", "kind": "basic", - "name": "anonymousBody", + "name": "GetXmlAdvancedModel", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "body parameter without body decorator", + "doc": "Get an advanced XML model with various property types", "operation": { - "$id": "853", - "name": "anonymousBody", + "$id": "1059", + "name": "GetXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "body parameter without body decorator", + "doc": "Get an advanced XML model with various property types", "accessibility": "public", "parameters": [ { - "$id": "854", - "kind": "query", - "name": "requiredQueryParam", - "serializedName": "requiredQueryParam", - "type": { - "$ref": "156" - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Constant", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "855", - "kind": "method", - "name": "requiredQueryParam", - "serializedName": "requiredQueryParam", - "type": { - "$ref": "158" - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "856", + "$id": "1060", "kind": "header", - "name": "requiredHeader", - "serializedName": "required-header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "160" + "$ref": "208" }, "isApiVersion": false, "optional": false, @@ -12709,21 +16162,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "857", + "$id": "1061", "kind": "method", - "name": "requiredHeader", - "serializedName": "required-header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "162" + "$ref": "208" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -12731,15 +16184,87 @@ } ], "isExactName": false - }, + } + ], + "responses": [ { - "$id": "858", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "506" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "210" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/xml" + ], + "serializationOptions": { + "xml": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/xmlAdvanced", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1061" + } + ], + "response": { + "type": { + "$ref": "506" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" + }, + { + "$id": "1062", + "kind": "basic", + "name": "UpdateXmlAdvancedModel", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update an advanced XML model with various property types", + "operation": { + "$id": "1063", + "name": "UpdateXmlAdvancedModel", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Update an advanced XML model with various property types", + "accessibility": "public", + "parameters": [ + { + "$id": "1064", "kind": "header", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "164" + "$ref": "212" }, "isApiVersion": false, "optional": false, @@ -12747,22 +16272,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "methodParameterSegments": [ { - "$id": "859", + "$id": "1065", "kind": "method", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "164" + "$ref": "212" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -12772,12 +16296,12 @@ "isExactName": false }, { - "$id": "860", + "$id": "1066", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "166" + "$ref": "216" }, "isApiVersion": false, "optional": false, @@ -12785,21 +16309,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "861", + "$id": "1067", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "166" + "$ref": "216" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -12809,42 +16333,37 @@ "isExactName": false }, { - "$id": "862", + "$id": "1068", "kind": "body", - "name": "thing", - "serializedName": "thing", + "name": "body", + "serializedName": "body", "type": { - "$ref": "294" + "$ref": "506" }, "isApiVersion": false, "contentTypes": [ - "application/json" + "application/xml" ], - "defaultContentType": "application/json", + "defaultContentType": "application/xml", "optional": false, - "scope": "Spread", + "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "methodParameterSegments": [ { - "$id": "863", + "$id": "1069", "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "name of the Thing", + "name": "body", + "serializedName": "body", "type": { - "$id": "864", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "506" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.name", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "readOnly": false, "access": "public", "decorators": [], @@ -12853,8 +16372,8 @@ ], "isExactName": false, "serializationOptions": { - "json": { - "name": "" + "xml": { + "name": "body" } } } @@ -12865,551 +16384,394 @@ 200 ], "bodyType": { - "$ref": "294" + "$ref": "506" }, - "headers": [], + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "218" + } + } + ], "isErrorResponse": false, "contentTypes": [ - "application/json" + "application/xml" ], "serializationOptions": { - "json": { + "xml": { "name": "" } } } ], - "httpMethod": "POST", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/anonymousBody", + "path": "/xmlAdvanced", "requestMediaTypes": [ - "application/json" + "application/xml" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "863" - }, - { - "$id": "865", - "kind": "method", - "name": "requiredUnion", - "serializedName": "requiredUnion", - "doc": "required Union", - "type": { - "$ref": "298" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredUnion", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "866", - "kind": "method", - "name": "requiredLiteralString", - "serializedName": "requiredLiteralString", - "doc": "required literal string", - "type": { - "$ref": "100" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "867", - "kind": "method", - "name": "requiredNullableString", - "serializedName": "requiredNullableString", - "doc": "required nullable string", - "type": { - "$ref": "305" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "868", - "kind": "method", - "name": "optionalNullableString", - "serializedName": "optionalNullableString", - "doc": "required optional string", - "type": { - "$ref": "308" - }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "869", - "kind": "method", - "name": "requiredLiteralInt", - "serializedName": "requiredLiteralInt", - "doc": "required literal int", - "type": { - "$ref": "102" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralInt", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "870", - "kind": "method", - "name": "requiredLiteralFloat", - "serializedName": "requiredLiteralFloat", - "doc": "required literal float", - "type": { - "$ref": "104" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralFloat", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1069" }, { - "$id": "871", - "kind": "method", - "name": "requiredLiteralBool", - "serializedName": "requiredLiteralBool", - "doc": "required literal bool", - "type": { - "$ref": "106" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralBool", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "$ref": "1065" }, { - "$id": "872", - "kind": "method", - "name": "optionalLiteralString", - "serializedName": "optionalLiteralString", - "doc": "optional literal string", - "type": { - "$id": "873", - "kind": "enum", - "name": "ThingOptionalLiteralString", - "apiVersions": [], - "crossLanguageDefinitionId": "", - "valueType": { - "$id": "874", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "1067" + } + ], + "response": { + "type": { + "$ref": "506" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" + }, + { + "$id": "1070", + "kind": "basic", + "name": "uploadCat", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1071", + "name": "uploadCat", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1072", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "220" }, - "values": [ + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", + "methodParameterSegments": [ { - "$id": "875", - "kind": "enumvalue", - "name": "reject", - "value": "reject", - "valueType": { - "$id": "876", - "kind": "string", - "decorators": [], - "doc": "A sequence of textual characters.", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "enumType": { - "$ref": "873" + "$id": "1073", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "220" }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", + "readOnly": false, + "access": "public", "decorators": [], "isExactName": false } ], - "namespace": "SampleTypeSpec", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [], "isExactName": false }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, + { + "$id": "1074", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "602" + }, + "isApiVersion": false, + "contentTypes": [ + "multipart/form-data" + ], + "defaultContentType": "multipart/form-data", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", + "methodParameterSegments": [ + { + "$id": "1075", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "602" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": {} + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/cats", + "requestMediaTypes": [ + "multipart/form-data" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ { - "$id": "877", - "kind": "method", - "name": "requiredNullableLiteralString", - "serializedName": "requiredNullableLiteralString", - "doc": "required nullable literal string", - "type": { - "$ref": "315" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableLiteralString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "$ref": "1073" }, { - "$id": "878", - "kind": "method", - "name": "optionalLiteralInt", - "serializedName": "optionalLiteralInt", - "doc": "optional literal int", - "type": { - "$id": "879", - "kind": "enum", - "name": "ThingOptionalLiteralInt", - "apiVersions": [], - "crossLanguageDefinitionId": "", - "valueType": { - "$id": "880", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] + "$ref": "1075" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" + }, + { + "$id": "1076", + "kind": "basic", + "name": "sendJsonLines", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1077", + "name": "sendJsonLines", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1078", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "224" }, - "values": [ - { - "$id": "881", - "kind": "enumvalue", - "name": "456", - "value": 456, - "valueType": { - "$id": "882", - "kind": "int32", - "decorators": [], - "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32" + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", + "methodParameterSegments": [ + { + "$id": "1079", + "kind": "method", + "name": "stream", + "serializedName": "stream", + "type": { + "$id": "1080", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "647" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" }, - "enumType": { - "$ref": "879" + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines.stream", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "1081", + "kind": "method", + "name": "contentType", + "serializedName": "contentType", + "type": { + "$ref": "226" }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", + "readOnly": false, + "access": "public", "decorators": [], "isExactName": false } ], - "namespace": "SampleTypeSpec", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [], "isExactName": false }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralInt", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "883", - "kind": "method", - "name": "optionalLiteralFloat", - "serializedName": "optionalLiteralFloat", - "doc": "optional literal float", - "type": { - "$id": "884", - "kind": "enum", - "name": "ThingOptionalLiteralFloat", - "apiVersions": [], - "crossLanguageDefinitionId": "", - "valueType": { - "$id": "885", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] + { + "$id": "1082", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$id": "1083", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "647" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" }, - "values": [ + "isApiVersion": false, + "contentTypes": [ + "application/jsonl" + ], + "defaultContentType": "application/jsonl", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", + "methodParameterSegments": [ { - "$id": "886", - "kind": "enumvalue", - "name": "4.56", - "value": 4.56, - "valueType": { - "$id": "887", - "kind": "float32", - "decorators": [], - "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32" - }, - "enumType": { - "$ref": "884" + "$ref": "1079" + }, + { + "$id": "1084", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "807" }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", + "readOnly": false, + "access": "public", "decorators": [], "isExactName": false } ], - "namespace": "SampleTypeSpec", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [], - "isExactName": false - }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralFloat", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "888", - "kind": "method", - "name": "optionalLiteralBool", - "serializedName": "optionalLiteralBool", - "doc": "optional literal bool", - "type": { - "$ref": "108" - }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralBool", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "889", - "kind": "method", - "name": "requiredBadDescription", - "serializedName": "requiredBadDescription", - "doc": "description with xml <|endoftext|>", - "type": { - "$id": "890", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredBadDescription", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "891", - "kind": "method", - "name": "optionalNullableList", - "serializedName": "optionalNullableList", - "doc": "optional nullable collection", - "type": { - "$ref": "322" - }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableList", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "892", - "kind": "method", - "name": "requiredNullableList", - "serializedName": "requiredNullableList", - "doc": "required nullable collection", - "type": { - "$ref": "326" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableList", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "893", - "kind": "method", - "name": "propertyWithSpecialDocs", - "serializedName": "propertyWithSpecialDocs", - "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", - "type": { - "$id": "894", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.propertyWithSpecialDocs", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$ref": "855" - }, - { - "$ref": "857" - }, - { - "$ref": "859" - }, + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/streaming/jsonl/send", + "requestMediaTypes": [ + "application/jsonl" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ { - "$ref": "861" + "$ref": "1079" } ], - "response": { - "type": { - "$ref": "294" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" + "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" }, { - "$id": "895", + "$id": "1085", "kind": "basic", - "name": "friendlyModel", + "name": "receiveJsonLines", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Model can have its friendly name", "operation": { - "$id": "896", - "name": "friendlyModel", + "$id": "1086", + "name": "receiveJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Model can have its friendly name", "accessibility": "public", "parameters": [ { - "$id": "897", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "178" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", - "methodParameterSegments": [ - { - "$id": "898", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "178" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "899", + "$id": "1087", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "180" + "$ref": "228" }, "isApiVersion": false, "optional": false, @@ -13417,21 +16779,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "methodParameterSegments": [ { - "$id": "900", + "$id": "1088", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "180" + "$ref": "228" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "readOnly": false, "access": "public", "decorators": [], @@ -13439,56 +16801,6 @@ } ], "isExactName": false - }, - { - "$id": "901", - "kind": "body", - "name": "friend", - "serializedName": "friend", - "type": { - "$ref": "385" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Spread", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", - "methodParameterSegments": [ - { - "$id": "902", - "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "name of the NotFriend", - "type": { - "$id": "903", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.name", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "" - } - } } ], "responses": [ @@ -13497,12 +16809,30 @@ 200 ], "bodyType": { - "$ref": "385" + "$id": "1089", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "647" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" }, - "headers": [], + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "230" + } + } + ], "isErrorResponse": false, "contentTypes": [ - "application/json" + "application/jsonl" ], "serializationOptions": { "json": { @@ -13511,44 +16841,45 @@ } } ], - "httpMethod": "POST", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/friendlyName", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, + "path": "/streaming/jsonl/receive", + "bufferResponse": false, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "902" - }, - { - "$ref": "898" - }, - { - "$ref": "900" + "$ref": "1088" } ], "response": { "type": { - "$ref": "385" + "$id": "1090", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "647" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" }, { - "$id": "904", + "$id": "1091", "kind": "basic", - "name": "addTimeHeader", + "name": "receiveSse", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -13556,65 +16887,41 @@ "2024-08-16-preview" ], "operation": { - "$id": "905", - "name": "addTimeHeader", + "$id": "1092", + "name": "receiveSse", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "906", + "$id": "1093", "kind": "header", - "name": "repeatabilityFirstSent", - "serializedName": "Repeatability-First-Sent", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "907", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc7231", - "wireType": { - "$id": "908", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] + "$ref": "232" }, "isApiVersion": false, - "optional": true, + "optional": false, "isContentType": false, - "scope": "Method", + "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "methodParameterSegments": [ { - "$id": "909", + "$id": "1094", "kind": "method", - "name": "repeatabilityFirstSent", - "serializedName": "Repeatability-First-Sent", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "910", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc7231", - "wireType": { - "$id": "911", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] + "$ref": "232" }, "location": "Header", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "readOnly": false, "access": "public", "decorators": [], @@ -13627,99 +16934,111 @@ "responses": [ { "statusCodes": [ - 204 + 200 + ], + "bodyType": { + "$id": "1095", + "kind": "streaming", + "name": "SSEStreamSampleEvents", + "valueType": { + "$id": "1096", + "kind": "union", + "name": "SampleEvents", + "variantTypes": [ + { + "$ref": "647" + }, + { + "$ref": "234" + } + ], + "namespace": "SampleTypeSpec", + "decorators": [], + "isExactName": false + }, + "streamKind": "sse", + "contentTypes": [ + "text/event-stream" + ], + "terminalEventValue": "[DONE]", + "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "236" + } + } ], - "headers": [], "isErrorResponse": false, + "contentTypes": [ + "text/event-stream" + ], "serializationOptions": {} } ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/", - "bufferResponse": true, + "path": "/streaming/sse/receive", + "bufferResponse": false, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "909" + "$ref": "1094" } ], - "response": {}, + "response": { + "type": { + "$id": "1097", + "kind": "streaming", + "name": "SSEStreamSampleEvents", + "valueType": { + "$ref": "1096" + }, + "streamKind": "sse", + "contentTypes": [ + "text/event-stream" + ], + "terminalEventValue": "[DONE]", + "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" }, { - "$id": "912", + "$id": "1098", "kind": "basic", - "name": "projectedNameModel", + "name": "receiveExperimentalJsonLines", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Model can have its projected name", "operation": { - "$id": "913", - "name": "projectedNameModel", + "$id": "1099", + "name": "receiveExperimentalJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Model can have its projected name", "accessibility": "public", "parameters": [ { - "$id": "914", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "182" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", - "methodParameterSegments": [ - { - "$id": "915", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "182" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "916", + "$id": "1100", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "184" + "$ref": "238" }, "isApiVersion": false, "optional": false, @@ -13727,21 +17046,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", "methodParameterSegments": [ { - "$id": "917", + "$id": "1101", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "184" + "$ref": "238" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", "readOnly": false, "access": "public", "decorators": [], @@ -13749,56 +17068,6 @@ } ], "isExactName": false - }, - { - "$id": "918", - "kind": "body", - "name": "renamedModel", - "serializedName": "renamedModel", - "type": { - "$ref": "388" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Spread", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", - "methodParameterSegments": [ - { - "$id": "919", - "kind": "method", - "name": "otherName", - "serializedName": "otherName", - "doc": "name of the ModelWithClientName", - "type": { - "$id": "920", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.otherName", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "" - } - } } ], "responses": [ @@ -13807,12 +17076,30 @@ 200 ], "bodyType": { - "$ref": "388" + "$id": "1102", + "kind": "streaming", + "name": "JsonlStreamPreviewDetails", + "valueType": { + "$ref": "650" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" }, - "headers": [], + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "240" + } + } + ], "isErrorResponse": false, "contentTypes": [ - "application/json" + "application/jsonl" ], "serializationOptions": { "json": { @@ -13821,88 +17108,145 @@ } } ], - "httpMethod": "POST", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/projectedName", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, + "path": "/experimental/jsonl", + "bufferResponse": false, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "919" - }, - { - "$ref": "915" - }, - { - "$ref": "917" + "$ref": "1101" } ], "response": { "type": { - "$ref": "388" + "$id": "1103", + "kind": "streaming", + "name": "JsonlStreamPreviewDetails", + "valueType": { + "$ref": "650" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines" }, { - "$id": "921", + "$id": "1104", "kind": "basic", - "name": "returnsAnonymousModel", + "name": "getAcronymParameters", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "return anonymous model", + "doc": "Send acronym-named path, query, and header parameters.", "operation": { - "$id": "922", - "name": "returnsAnonymousModel", + "$id": "1105", + "name": "getAcronymParameters", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "return anonymous model", + "doc": "Send acronym-named path, query, and header parameters.", "accessibility": "public", "parameters": [ { - "$id": "923", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1106", + "kind": "path", + "name": "targetDbName", + "serializedName": "targetDbName", "type": { - "$ref": "186" + "$id": "1107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", "methodParameterSegments": [ { - "$id": "924", + "$id": "1108", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "targetDbName", + "serializedName": "targetDbName", "type": { - "$ref": "186" + "$id": "1109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Header", + "location": "Path", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1110", + "kind": "query", + "name": "sourceIpAddress", + "serializedName": "sourceIpAddress", + "type": { + "$id": "1111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "1112", + "kind": "method", + "name": "sourceIpAddress", + "serializedName": "sourceIpAddress", + "type": { + "$id": "1113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", "readOnly": false, "access": "public", "decorators": [], @@ -13910,101 +17254,44 @@ } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "391" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/returnsAnonymousModel", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "924" - } - ], - "response": { - "type": { - "$ref": "391" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" - }, - { - "$id": "925", - "kind": "basic", - "name": "getUnknownValue", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "get extensible enum", - "operation": { - "$id": "926", - "name": "getUnknownValue", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "get extensible enum", - "accessibility": "public", - "parameters": [ + }, { - "$id": "927", + "$id": "1114", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "guestOsType", + "serializedName": "X-Guest-OS-Type", "type": { - "$ref": "188" + "$id": "1115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, - "optional": false, + "optional": true, "isContentType": false, - "scope": "Constant", + "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", "methodParameterSegments": [ { - "$id": "928", + "$id": "1116", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "guestOsType", + "serializedName": "X-Guest-OS-Type", "type": { - "$ref": "188" + "$id": "1117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "location": "Header", "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", "readOnly": false, "access": "public", "decorators": [], @@ -14017,131 +17304,96 @@ "responses": [ { "statusCodes": [ - 200 + 204 ], - "bodyType": { - "$ref": "87" - }, "headers": [], "isErrorResponse": false, - "contentTypes": [ - "text/plain" - ], "serializationOptions": {} } ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/unknown-value", + "path": "/acronyms/{targetDbName}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "928" + "$ref": "1108" + }, + { + "$ref": "1112" + }, + { + "$ref": "1116" } ], - "response": { - "type": { - "$ref": "87" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters" }, { - "$id": "929", + "$id": "1118", "kind": "basic", - "name": "internalProtocol", + "name": "setAcronymAddresses", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "When set protocol false and convenient true, then the protocol method should be internal", + "doc": "Send parameters with leading IP version acronyms.", "operation": { - "$id": "930", - "name": "internalProtocol", + "$id": "1119", + "name": "setAcronymAddresses", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "When set protocol false and convenient true, then the protocol method should be internal", + "doc": "Send parameters with leading IP version acronyms.", "accessibility": "public", "parameters": [ { - "$id": "931", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "1120", + "kind": "query", + "name": "ipV4Address", + "serializedName": "ipV4Address", "type": { - "$ref": "190" + "$id": "1121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, + "explode": false, "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", - "methodParameterSegments": [ - { - "$id": "932", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "190" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "933", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "192" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "934", + "$id": "1122", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "ipV4Address", + "serializedName": "ipV4Address", "type": { - "$ref": "192" + "$id": "1123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Header", + "location": "Query", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", "readOnly": false, "access": "public", "decorators": [], @@ -14151,124 +17403,51 @@ "isExactName": false }, { - "$id": "935", - "kind": "body", - "name": "body", - "serializedName": "body", + "$id": "1124", + "kind": "query", + "name": "ipV6Address", + "serializedName": "ipV6Address", "type": { - "$ref": "294" + "$id": "1125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, + "explode": false, + "optional": true, "scope": "Method", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "936", + "$id": "1126", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "ipV6Address", + "serializedName": "ipV6Address", "type": { - "$ref": "294" + "$id": "1127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Body", + "location": "Query", "isApiVersion": false, - "optional": false, + "optional": true, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", "readOnly": false, "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "294" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "isExactName": false } ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/internalProtocol", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": false, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "936" - }, - { - "$ref": "932" - }, - { - "$ref": "934" - } - ], - "response": { - "type": { - "$ref": "294" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": false, - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" - }, - { - "$id": "937", - "kind": "basic", - "name": "stillConvenient", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", - "operation": { - "$id": "938", - "name": "stillConvenient", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", - "accessibility": "public", - "parameters": [], "responses": [ { "statusCodes": [ @@ -14279,2847 +17458,3498 @@ "serializationOptions": {} } ], - "httpMethod": "GET", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/stillConvenient", + "path": "/acronyms/addresses", "bufferResponse": true, - "generateProtocolMethod": false, + "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient", + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses", "decorators": [], "namespace": "SampleTypeSpec" }, - "parameters": [], + "parameters": [ + { + "$ref": "1122" + }, + { + "$ref": "1126" + } + ], "response": {}, "isOverride": false, "generateConvenient": true, - "generateProtocol": false, - "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses" + } + ], + "parameters": [ + { + "$id": "1128", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1129", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.sampleTypeSpecUrl", + "isExactName": false }, { - "$id": "939", - "kind": "basic", - "name": "headAsBoolean", + "$ref": "1002" + } + ], + "initializedBy": 1, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "children": [ + { + "$id": "1130", + "kind": "client", + "name": "ExperimentalSamples", "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "head as boolean.", - "operation": { - "$id": "940", - "name": "headAsBoolean", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "head as boolean.", - "accessibility": "public", - "parameters": [ - { - "$id": "941", - "kind": "path", - "name": "id", - "serializedName": "id", - "type": { - "$id": "942", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Method", + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1131", + "kind": "basic", + "name": "read", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1132", + "name": "read", + "isExactName": false, + "resourceName": "ExperimentalSamples", + "accessibility": "public", + "parameters": [ + { + "$id": "1133", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "242" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", + "methodParameterSegments": [ + { + "$id": "1134", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "242" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "652" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/experimental", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read", "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", - "methodParameterSegments": [ + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1134" + } + ], + "response": { + "type": { + "$ref": "652" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read" + }, + { + "$id": "1135", + "kind": "paging", + "name": "list", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1136", + "name": "list", + "isExactName": false, + "resourceName": "ExperimentalSamples", + "accessibility": "public", + "parameters": [ { - "$id": "943", - "kind": "method", - "name": "id", - "serializedName": "id", + "$id": "1137", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "944", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "244" }, - "location": "Path", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", + "isContentType": false, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", + "methodParameterSegments": [ + { + "$id": "1138", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "244" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 204 + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "655" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/experimental/pages", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1138" + } + ], + "response": { + "type": { + "$ref": "657" + }, + "resultSegments": [ + "items" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", + "pagingMetadata": { + "itemPropertySegments": [ + "items" + ], + "pageSizeParameterSegments": [] } - ], - "httpMethod": "HEAD", - "uri": "{sampleTypeSpecUrl}", - "path": "/headAsBoolean/{id}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + } + ], "parameters": [ { - "$ref": "943" + "$id": "1139", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1140", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.sampleTypeSpecUrl", + "isExactName": false } ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" - }, - { - "$id": "945", - "kind": "basic", - "name": "WithApiVersion", - "isExactName": false, - "accessibility": "public", + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Return hi again", - "operation": { - "$id": "946", - "name": "WithApiVersion", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Return hi again", - "accessibility": "public", - "parameters": [ - { - "$id": "947", - "kind": "header", - "name": "p1", - "serializedName": "p1", - "type": { - "$id": "948", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", - "methodParameterSegments": [ + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false, + "experimental": { + "diagnosticId": "SAMPLE0009", + "dependsOn": [] + } + }, + { + "$id": "1141", + "kind": "client", + "name": "AnimalOperations", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1142", + "kind": "basic", + "name": "updatePetAsAnimal", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a pet as an animal", + "operation": { + "$id": "1143", + "name": "updatePetAsAnimal", + "isExactName": false, + "resourceName": "AnimalOperations", + "doc": "Update a pet as an animal", + "accessibility": "public", + "parameters": [ + { + "$id": "1144", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "246" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", + "methodParameterSegments": [ + { + "$id": "1145", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "246" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1146", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "248" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", + "methodParameterSegments": [ + { + "$id": "1147", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "248" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "949", - "kind": "method", - "name": "p1", - "serializedName": "p1", + "$id": "1148", + "kind": "body", + "name": "animal", + "serializedName": "animal", "type": { - "$id": "950", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "658" }, - "location": "Header", "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", - "readOnly": false, - "access": "public", "decorators": [], - "isExactName": false + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", + "methodParameterSegments": [ + { + "$id": "1149", + "kind": "method", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "658" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "animal" + } + } } ], - "isExactName": false + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "658" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/animals/pet/as-animal", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal", + "decorators": [], + "namespace": "SampleTypeSpec" }, - { - "$id": "951", - "kind": "query", - "name": "apiVersion", - "serializedName": "apiVersion", - "type": { - "$id": "952", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "parameters": [ + { + "$ref": "1149" }, - "isApiVersion": true, - "explode": false, - "defaultValue": { - "type": { - "$id": "953", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "2024-08-16-preview" + { + "$ref": "1145" }, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", - "readOnly": false, - "methodParameterSegments": [ + { + "$ref": "1147" + } + ], + "response": { + "type": { + "$ref": "658" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" + }, + { + "$id": "1150", + "kind": "basic", + "name": "updateDogAsAnimal", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a dog as an animal", + "operation": { + "$id": "1151", + "name": "updateDogAsAnimal", + "isExactName": false, + "resourceName": "AnimalOperations", + "doc": "Update a dog as an animal", + "accessibility": "public", + "parameters": [ { - "$id": "954", - "kind": "method", - "name": "apiVersion", - "serializedName": "apiVersion", + "$id": "1152", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "955", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": true, - "defaultValue": { - "type": { - "$id": "956", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "2024-08-16-preview" + "$ref": "250" }, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", + "methodParameterSegments": [ + { + "$id": "1153", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "250" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/WithApiVersion", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "949" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" - }, - { - "$id": "957", - "kind": "paging", - "name": "ListWithNextLink", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "List things with nextlink", - "operation": { - "$id": "958", - "name": "ListWithNextLink", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with nextlink", - "accessibility": "public", - "parameters": [ - { - "$id": "959", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "194" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", - "methodParameterSegments": [ + }, { - "$id": "960", - "kind": "method", + "$id": "1154", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "194" + "$ref": "252" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", + "methodParameterSegments": [ + { + "$id": "1155", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "252" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false + }, + { + "$id": "1156", + "kind": "body", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "658" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", + "methodParameterSegments": [ + { + "$id": "1157", + "kind": "method", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "658" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "animal" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "658" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } ], - "bodyType": { - "$ref": "392" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/animals/dog/as-animal", + "requestMediaTypes": [ "application/json" ], - "serializationOptions": { - "json": { - "name": "" - } + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1157" + }, + { + "$ref": "1153" + }, + { + "$ref": "1155" } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/link", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + ], + "response": { + "type": { + "$ref": "658" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal" + } + ], "parameters": [ { - "$ref": "960" + "$id": "1158", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1159", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.sampleTypeSpecUrl", + "isExactName": false } ], - "response": { - "type": { - "$ref": "394" - }, - "resultSegments": [ - "things" - ] - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "nextLink": { - "verb": "GET", - "responseSegments": [ - "next" - ], - "responseLocation": "Body" - }, - "pageSizeParameterSegments": [] - } - }, - { - "$id": "961", - "kind": "paging", - "name": "ListWithStringNextLink", - "isExactName": false, - "accessibility": "public", + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "List things with nextlink", - "operation": { - "$id": "962", - "name": "ListWithStringNextLink", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with nextlink", - "accessibility": "public", - "parameters": [ - { - "$id": "963", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "196" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", - "methodParameterSegments": [ + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1160", + "kind": "client", + "name": "PetOperations", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1161", + "kind": "basic", + "name": "updatePetAsPet", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a pet as a pet", + "operation": { + "$id": "1162", + "name": "updatePetAsPet", + "isExactName": false, + "resourceName": "PetOperations", + "doc": "Update a pet as a pet", + "accessibility": "public", + "parameters": [ + { + "$id": "1163", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "254" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", + "methodParameterSegments": [ + { + "$id": "1164", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "254" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "964", - "kind": "method", + "$id": "1165", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "196" + "$ref": "256" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", + "methodParameterSegments": [ + { + "$id": "1166", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "256" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false + }, + { + "$id": "1167", + "kind": "body", + "name": "pet", + "serializedName": "pet", + "type": { + "$ref": "663" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", + "methodParameterSegments": [ + { + "$id": "1168", + "kind": "method", + "name": "pet", + "serializedName": "pet", + "type": { + "$ref": "663" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "pet" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "663" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } ], - "bodyType": { - "$ref": "397" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/pets/pet/as-pet", + "requestMediaTypes": [ "application/json" ], - "serializationOptions": { - "json": { - "name": "" - } + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1168" + }, + { + "$ref": "1164" + }, + { + "$ref": "1166" } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/linkString", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "964" - } - ], - "response": { - "type": { - "$ref": "394" - }, - "resultSegments": [ - "things" - ] - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "nextLink": { - "verb": "GET", - "responseSegments": [ - "next" ], - "responseLocation": "Body" - }, - "pageSizeParameterSegments": [] - } - }, - { - "$id": "965", - "kind": "paging", - "name": "ListWithContinuationToken", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "List things with continuation token", - "operation": { - "$id": "966", - "name": "ListWithContinuationToken", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with continuation token", - "accessibility": "public", - "parameters": [ - { - "$id": "967", - "kind": "query", - "name": "token", - "serializedName": "token", + "response": { "type": { - "$id": "968", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", - "readOnly": false, - "methodParameterSegments": [ + "$ref": "663" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" + }, + { + "$id": "1169", + "kind": "basic", + "name": "updateDogAsPet", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a dog as a pet", + "operation": { + "$id": "1170", + "name": "updateDogAsPet", + "isExactName": false, + "resourceName": "PetOperations", + "doc": "Update a dog as a pet", + "accessibility": "public", + "parameters": [ { - "$id": "969", - "kind": "method", - "name": "token", - "serializedName": "token", - "type": { - "$id": "970", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$id": "1171", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "258" }, - "location": "Query", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", + "optional": false, + "isContentType": true, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", + "methodParameterSegments": [ + { + "$id": "1172", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "258" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "971", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "198" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", - "methodParameterSegments": [ + }, { - "$id": "972", - "kind": "method", + "$id": "1173", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "198" + "$ref": "260" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", + "methodParameterSegments": [ + { + "$id": "1174", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "260" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false + }, + { + "$id": "1175", + "kind": "body", + "name": "pet", + "serializedName": "pet", + "type": { + "$ref": "663" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", + "methodParameterSegments": [ + { + "$id": "1176", + "kind": "method", + "name": "pet", + "serializedName": "pet", + "type": { + "$ref": "663" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "pet" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "663" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } ], - "bodyType": { - "$ref": "401" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/pets/dog/as-pet", + "requestMediaTypes": [ "application/json" ], - "serializationOptions": { - "json": { - "name": "" - } + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1176" + }, + { + "$ref": "1172" + }, + { + "$ref": "1174" } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/continuation", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + ], + "response": { + "type": { + "$ref": "663" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet" + } + ], "parameters": [ { - "$ref": "969" - }, - { - "$ref": "972" + "$id": "1177", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1178", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.sampleTypeSpecUrl", + "isExactName": false } ], - "response": { - "type": { - "$ref": "394" - }, - "resultSegments": [ - "things" - ] + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "808" }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "continuationToken": { - "parameter": { - "$ref": "967" - }, - "responseSegments": [ - "nextToken" - ], - "responseLocation": "Body" - }, - "pageSizeParameterSegments": [] - } + "isMultiServiceClient": false }, { - "$id": "973", - "kind": "paging", - "name": "ListWithContinuationTokenHeaderResponse", + "$id": "1179", + "kind": "client", + "name": "DogOperations", "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "List things with continuation token header response", - "operation": { - "$id": "974", - "name": "ListWithContinuationTokenHeaderResponse", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with continuation token header response", - "accessibility": "public", - "parameters": [ - { - "$id": "975", - "kind": "query", - "name": "token", - "serializedName": "token", - "type": { - "$id": "976", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", - "readOnly": false, - "methodParameterSegments": [ + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1180", + "kind": "basic", + "name": "updateDogAsDog", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a dog as a dog", + "operation": { + "$id": "1181", + "name": "updateDogAsDog", + "isExactName": false, + "resourceName": "DogOperations", + "doc": "Update a dog as a dog", + "accessibility": "public", + "parameters": [ { - "$id": "977", - "kind": "method", - "name": "token", - "serializedName": "token", + "$id": "1182", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "978", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "262" }, - "location": "Query", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", + "optional": false, + "isContentType": true, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", + "methodParameterSegments": [ + { + "$id": "1183", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "262" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "979", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "200" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", - "methodParameterSegments": [ + }, { - "$id": "980", - "kind": "method", + "$id": "1184", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "200" + "$ref": "264" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", + "methodParameterSegments": [ + { + "$id": "1185", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "264" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false + }, + { + "$id": "1186", + "kind": "body", + "name": "dog", + "serializedName": "dog", + "type": { + "$ref": "667" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", + "methodParameterSegments": [ + { + "$id": "1187", + "kind": "method", + "name": "dog", + "serializedName": "dog", + "type": { + "$ref": "667" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "dog" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "405" - }, - "headers": [ + "responses": [ { - "name": "nextToken", - "nameInResponse": "next-token", - "type": { - "$id": "981", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "667" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } } } ], - "isErrorResponse": false, - "contentTypes": [ + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/dogs/dog/as-dog", + "requestMediaTypes": [ "application/json" ], - "serializationOptions": { - "json": { - "name": "" - } + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1187" + }, + { + "$ref": "1183" + }, + { + "$ref": "1185" } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/continuation/header", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + ], + "response": { + "type": { + "$ref": "667" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog" + } + ], "parameters": [ { - "$ref": "977" - }, - { - "$ref": "980" + "$id": "1188", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1189", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.sampleTypeSpecUrl", + "isExactName": false } ], - "response": { - "type": { - "$ref": "394" - }, - "resultSegments": [ - "things" - ] - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "continuationToken": { - "parameter": { - "$ref": "975" - }, - "responseSegments": [ - "next-token" - ], - "responseLocation": "Header" - }, - "pageSizeParameterSegments": [] - } - }, - { - "$id": "982", - "kind": "paging", - "name": "ListWithPaging", - "isExactName": false, - "accessibility": "public", + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "List things with paging", - "operation": { - "$id": "983", - "name": "ListWithPaging", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with paging", - "accessibility": "public", - "parameters": [ - { - "$id": "984", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "202" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", - "methodParameterSegments": [ + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1190", + "kind": "client", + "name": "PlantOperations", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1191", + "kind": "basic", + "name": "getTree", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Get a tree as a plant", + "operation": { + "$id": "1192", + "name": "getTree", + "isExactName": false, + "resourceName": "PlantOperations", + "doc": "Get a tree as a plant", + "accessibility": "public", + "parameters": [ { - "$id": "985", - "kind": "method", + "$id": "1193", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "202" + "$ref": "266" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", + "methodParameterSegments": [ + { + "$id": "1194", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "266" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "407" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "671" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "268" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/xml" + ], + "serializationOptions": { + "xml": { + "name": "" + } + } } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/list/paging", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "985" - } - ], - "response": { - "type": { - "$ref": "394" - }, - "resultSegments": [ - "items" - ] - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", - "pagingMetadata": { - "itemPropertySegments": [ - "items" - ], - "pageSizeParameterSegments": [] - } - }, - { - "$id": "986", - "kind": "basic", - "name": "EmbeddedParameters", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "An operation with embedded parameters within the body", - "operation": { - "$id": "987", - "name": "EmbeddedParameters", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "An operation with embedded parameters within the body", - "accessibility": "public", - "parameters": [ - { - "$id": "988", - "kind": "header", - "name": "requiredHeader", - "serializedName": "required-header", - "doc": "required header parameter", - "type": { - "$id": "989", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Method", - "readOnly": false, + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/plants/tree/as-plant", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", - "methodParameterSegments": [ - { - "$id": "990", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "409" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1194" + } + ], + "response": { + "type": { + "$ref": "671" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" + }, + { + "$id": "1195", + "kind": "basic", + "name": "getTreeAsJson", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Get a tree as a plant", + "operation": { + "$id": "1196", + "name": "getTreeAsJson", + "isExactName": false, + "resourceName": "PlantOperations", + "doc": "Get a tree as a plant", + "accessibility": "public", + "parameters": [ { - "$id": "991", - "kind": "method", - "name": "requiredHeader", - "serializedName": "requiredHeader", - "doc": "required header parameter", + "$id": "1197", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "413" + "$ref": "270" }, - "location": "", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", + "isContentType": false, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", + "methodParameterSegments": [ + { + "$id": "1198", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "270" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - }, - { - "$id": "992", - "kind": "header", - "name": "optionalHeader", - "serializedName": "optional-header", - "doc": "optional header parameter", - "type": { - "$id": "993", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": true, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", - "methodParameterSegments": [ - { - "$ref": "990" - }, + "responses": [ { - "$id": "994", - "kind": "method", - "name": "optionalHeader", - "serializedName": "optionalHeader", - "doc": "optional header parameter", - "type": { - "$ref": "415" + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "671" }, - "location": "", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "272" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "isExactName": false + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/plants/tree/as-plant/json", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson", + "decorators": [], + "namespace": "SampleTypeSpec" }, - { - "$id": "995", - "kind": "query", - "name": "requiredQuery", - "serializedName": "requiredQuery", - "doc": "required query parameter", + "parameters": [ + { + "$ref": "1198" + } + ], + "response": { "type": { - "$id": "996", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", - "readOnly": false, - "methodParameterSegments": [ - { - "$ref": "990" - }, + "$ref": "671" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" + }, + { + "$id": "1199", + "kind": "basic", + "name": "updateTree", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a tree as a plant", + "operation": { + "$id": "1200", + "name": "updateTree", + "isExactName": false, + "resourceName": "PlantOperations", + "doc": "Update a tree as a plant", + "accessibility": "public", + "parameters": [ { - "$id": "997", - "kind": "method", - "name": "requiredQuery", - "serializedName": "requiredQuery", - "doc": "required query parameter", + "$id": "1201", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", "type": { - "$ref": "417" + "$ref": "274" }, - "location": "", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", + "isContentType": true, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "998", - "kind": "query", - "name": "optionalQuery", - "serializedName": "optionalQuery", - "doc": "optional query parameter", - "type": { - "$id": "999", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", - "readOnly": false, - "methodParameterSegments": [ - { - "$ref": "990" + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", + "methodParameterSegments": [ + { + "$id": "1202", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "274" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false }, { - "$id": "1000", - "kind": "method", - "name": "optionalQuery", - "serializedName": "optionalQuery", - "doc": "optional query parameter", + "$id": "1203", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "419" + "$ref": "278" }, - "location": "", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", + "optional": false, + "isContentType": false, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", + "methodParameterSegments": [ + { + "$id": "1204", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "278" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1001", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "204" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", - "methodParameterSegments": [ + }, { - "$id": "1002", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "1205", + "kind": "body", + "name": "tree", + "serializedName": "tree", "type": { - "$ref": "204" + "$ref": "671" }, - "location": "Header", "isApiVersion": false, + "contentTypes": [ + "application/xml" + ], + "defaultContentType": "application/xml", "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", - "readOnly": false, - "access": "public", + "scope": "Method", "decorators": [], - "isExactName": false + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", + "methodParameterSegments": [ + { + "$id": "1206", + "kind": "method", + "name": "tree", + "serializedName": "tree", + "type": { + "$ref": "671" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "xml": { + "name": "tree" + } + } } ], - "isExactName": false - }, - { - "$id": "1003", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "409" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", - "methodParameterSegments": [ + "responses": [ { - "$ref": "990" + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "671" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "280" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/xml" + ], + "serializationOptions": { + "xml": { + "name": "" + } + } } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 204 + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/plants/tree/as-plant", + "requestMediaTypes": [ + "application/xml" ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/embeddedParameters", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "990" - }, - { - "$ref": "1002" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" - }, - { - "$id": "1004", - "kind": "basic", - "name": "DynamicModelOperation", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "An operation with a dynamic model", - "operation": { - "$id": "1005", - "name": "DynamicModelOperation", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "An operation with a dynamic model", - "accessibility": "public", - "parameters": [ - { - "$id": "1006", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "206" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", - "methodParameterSegments": [ + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1206" + }, + { + "$ref": "1202" + }, + { + "$ref": "1204" + } + ], + "response": { + "type": { + "$ref": "671" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" + }, + { + "$id": "1207", + "kind": "basic", + "name": "updateTreeAsJson", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update a tree as a plant", + "operation": { + "$id": "1208", + "name": "updateTreeAsJson", + "isExactName": false, + "resourceName": "PlantOperations", + "doc": "Update a tree as a plant", + "accessibility": "public", + "parameters": [ { - "$id": "1007", - "kind": "method", + "$id": "1209", + "kind": "header", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "206" + "$ref": "282" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": true, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", + "methodParameterSegments": [ + { + "$id": "1210", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "282" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1008", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "420" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", - "methodParameterSegments": [ + }, { - "$id": "1009", - "kind": "method", - "name": "body", - "serializedName": "body", + "$id": "1211", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "420" + "$ref": "286" }, - "location": "Body", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", + "isContentType": false, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", + "methodParameterSegments": [ + { + "$id": "1212", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "286" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/dynamicModel", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation", - "decorators": [], - "namespace": "SampleTypeSpec", - "experimental": { - "diagnosticId": "SAMPLE0002", - "dependsOn": [ - "SCME0001" - ] - } - }, - "parameters": [ - { - "$ref": "1009" - }, - { - "$ref": "1007" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" - }, - { - "$id": "1010", - "kind": "basic", - "name": "GetXmlAdvancedModel", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Get an advanced XML model with various property types", - "operation": { - "$id": "1011", - "name": "GetXmlAdvancedModel", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Get an advanced XML model with various property types", - "accessibility": "public", - "parameters": [ - { - "$id": "1012", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "208" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", - "methodParameterSegments": [ + }, { - "$id": "1013", - "kind": "method", - "name": "accept", - "serializedName": "Accept", + "$id": "1213", + "kind": "body", + "name": "tree", + "serializedName": "tree", "type": { - "$ref": "208" + "$ref": "671" }, - "location": "Header", "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", - "readOnly": false, - "access": "public", + "scope": "Method", "decorators": [], - "isExactName": false + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", + "methodParameterSegments": [ + { + "$id": "1214", + "kind": "method", + "name": "tree", + "serializedName": "tree", + "type": { + "$ref": "671" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "tree" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "458" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "210" + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "671" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "288" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } } } ], - "isErrorResponse": false, - "contentTypes": [ - "application/xml" + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/plants/tree/as-plant/json", + "requestMediaTypes": [ + "application/json" ], - "serializationOptions": { - "xml": { - "name": "" - } + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1214" + }, + { + "$ref": "1210" + }, + { + "$ref": "1212" } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/xmlAdvanced", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + ], + "response": { + "type": { + "$ref": "671" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson" + } + ], "parameters": [ { - "$ref": "1013" + "$id": "1215", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1216", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.sampleTypeSpecUrl", + "isExactName": false } ], - "response": { - "type": { - "$ref": "458" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" - }, - { - "$id": "1014", - "kind": "basic", - "name": "UpdateXmlAdvancedModel", - "isExactName": false, - "accessibility": "public", + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update an advanced XML model with various property types", - "operation": { - "$id": "1015", - "name": "UpdateXmlAdvancedModel", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Update an advanced XML model with various property types", - "accessibility": "public", - "parameters": [ - { - "$id": "1016", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "212" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", - "methodParameterSegments": [ + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1217", + "kind": "client", + "name": "Metrics", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1218", + "kind": "basic", + "name": "getWidgetMetrics", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Get Widget metrics for given day of week", + "operation": { + "$id": "1219", + "name": "getWidgetMetrics", + "isExactName": false, + "resourceName": "Metrics", + "doc": "Get Widget metrics for given day of week", + "accessibility": "public", + "parameters": [ { - "$id": "1017", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", + "$id": "1220", + "kind": "path", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", "type": { - "$ref": "212" + "$id": "1221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Header", "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", - "readOnly": false, - "access": "public", + "scope": "Client", "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", + "methodParameterSegments": [ + { + "$id": "1222", + "kind": "method", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", + "type": { + "$id": "1223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1018", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "216" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", - "methodParameterSegments": [ + }, + { + "$id": "1224", + "kind": "path", + "name": "day", + "serializedName": "day", + "type": { + "$ref": "87" + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", + "methodParameterSegments": [ + { + "$id": "1225", + "kind": "method", + "name": "day", + "serializedName": "day", + "type": { + "$ref": "87" + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "1019", - "kind": "method", + "$id": "1226", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "216" + "$ref": "290" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", + "methodParameterSegments": [ + { + "$id": "1227", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "290" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - }, - { - "$id": "1020", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "458" - }, - "isApiVersion": false, - "contentTypes": [ - "application/xml" - ], - "defaultContentType": "application/xml", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", - "methodParameterSegments": [ + "responses": [ { - "$id": "1021", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "458" + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "687" }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "xml": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "458" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "218" + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } } } ], - "isErrorResponse": false, - "contentTypes": [ - "application/xml" - ], - "serializationOptions": { - "xml": { - "name": "" - } + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1225" + }, + { + "$ref": "1227" } - } - ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/xmlAdvanced", - "requestMediaTypes": [ - "application/xml" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + ], + "response": { + "type": { + "$ref": "687" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics" + } + ], "parameters": [ { - "$ref": "1021" - }, - { - "$ref": "1017" + "$id": "1228", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1229", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl", + "isExactName": false }, { - "$ref": "1019" + "$ref": "1222" } ], - "response": { - "type": { - "$ref": "458" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" - }, - { - "$id": "1022", - "kind": "basic", - "name": "uploadCat", - "isExactName": false, - "accessibility": "public", + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "operation": { - "$id": "1023", - "name": "uploadCat", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "1024", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "220" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", - "methodParameterSegments": [ + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1230", + "kind": "client", + "name": "Notebooks", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1231", + "kind": "basic", + "name": "getNotebook", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Get a notebook by name", + "operation": { + "$id": "1232", + "name": "getNotebook", + "isExactName": false, + "resourceName": "Notebooks", + "doc": "Get a notebook by name", + "accessibility": "public", + "parameters": [ + { + "$id": "1233", + "kind": "path", + "name": "notebookName", + "serializedName": "notebookName", + "type": { + "$id": "1234", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", + "methodParameterSegments": [ + { + "$id": "1235", + "kind": "method", + "name": "notebook", + "serializedName": "notebook", + "type": { + "$id": "1236", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.NotebookClientParams.notebook", + "readOnly": false, + "access": "public", + "decorators": [], + "paramAlias": "notebookName", + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "1025", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", + "$id": "1237", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "220" + "$ref": "292" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", + "methodParameterSegments": [ + { + "$id": "1238", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "292" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - }, - { - "$id": "1026", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "554" - }, - "isApiVersion": false, - "contentTypes": [ - "multipart/form-data" - ], - "defaultContentType": "multipart/form-data", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", - "methodParameterSegments": [ + "responses": [ { - "$id": "1027", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "554" + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "692" }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "isExactName": false, - "serializationOptions": {} - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/cats", - "requestMediaTypes": [ - "multipart/form-data" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/notebooks/{notebookName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1238" + } + ], + "response": { + "type": { + "$ref": "692" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook" + } + ], "parameters": [ { - "$ref": "1025" + "$id": "1239", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1240", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.sampleTypeSpecUrl", + "isExactName": false }, { - "$ref": "1027" + "$ref": "1235" } ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" - }, - { - "$id": "1028", - "kind": "basic", - "name": "sendJsonLines", - "isExactName": false, - "accessibility": "public", + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "operation": { - "$id": "1029", - "name": "sendJsonLines", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "1030", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "224" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", - "methodParameterSegments": [ - { - "$id": "1031", - "kind": "method", - "name": "stream", - "serializedName": "stream", - "type": { - "$id": "1032", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "599" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines.stream", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "1033", - "kind": "method", + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1241", + "kind": "client", + "name": "Int16Collections", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1242", + "kind": "basic", + "name": "sendNested", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1243", + "name": "sendNested", + "isExactName": false, + "resourceName": "Int16Collections", + "accessibility": "public", + "parameters": [ + { + "$id": "1244", + "kind": "header", "name": "contentType", - "serializedName": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "226" + "$ref": "294" }, - "location": "", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", + "isContentType": true, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.contentType", + "methodParameterSegments": [ + { + "$id": "1245", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "294" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1034", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$id": "1035", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "599" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - }, - "isApiVersion": false, - "contentTypes": [ - "application/jsonl" - ], - "defaultContentType": "application/jsonl", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", - "methodParameterSegments": [ - { - "$ref": "1031" }, { - "$id": "1036", - "kind": "method", + "$id": "1246", + "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "759" + "$id": "1247", + "kind": "array", + "name": "ArrayArray2", + "valueType": { + "$id": "1248", + "kind": "array", + "name": "Array2", + "valueType": { + "$id": "1249", + "kind": "int16", + "name": "int16", + "crossLanguageDefinitionId": "TypeSpec.int16", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, - "location": "", "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", - "readOnly": false, - "access": "public", "decorators": [], - "isExactName": false + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.body", + "methodParameterSegments": [ + { + "$id": "1250", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "1247" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} } - } - } - ], - "responses": [ - { - "statusCodes": [ - 204 ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/streaming/jsonl/send", - "requestMediaTypes": [ - "application/jsonl" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1031" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" - }, - { - "$id": "1037", - "kind": "basic", - "name": "receiveJsonLines", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1038", - "name": "receiveJsonLines", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "1039", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "228" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/int16-collections/nested-array", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", - "methodParameterSegments": [ + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1250" + }, + { + "$ref": "1245" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested" + }, + { + "$id": "1251", + "kind": "basic", + "name": "sendRecord", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1252", + "name": "sendRecord", + "isExactName": false, + "resourceName": "Int16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1040", - "kind": "method", - "name": "accept", - "serializedName": "Accept", + "$id": "1253", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "296" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": true, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "readOnly": false, - "access": "public", "decorators": [], - "isExactName": false + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.contentType", + "methodParameterSegments": [ + { + "$id": "1254", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "296" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1255", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$id": "1256", + "kind": "dict", + "keyType": { + "$id": "1257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "1248" + }, + "decorators": [] + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.body", + "methodParameterSegments": [ + { + "$id": "1258", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "1256" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1041", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "599" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - }, - "headers": [ + "responses": [ { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "230" - } + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} } ], - "isErrorResponse": false, - "contentTypes": [ - "application/jsonl" + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/int16-collections/record-of-arrays", + "requestMediaTypes": [ + "application/json" ], - "serializationOptions": { - "json": { - "name": "" - } + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1258" + }, + { + "$ref": "1254" } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/streaming/jsonl/receive", - "bufferResponse": false, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord" + }, { - "$ref": "1040" - } - ], - "response": { - "type": { - "$id": "1042", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "599" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" + "$id": "1259", + "kind": "basic", + "name": "getArray", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" - }, - { - "$id": "1043", - "kind": "basic", - "name": "receiveSse", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1044", - "name": "receiveSse", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "1045", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "232" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", - "methodParameterSegments": [ + "operation": { + "$id": "1260", + "name": "getArray", + "isExactName": false, + "resourceName": "Int16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1046", - "kind": "method", + "$id": "1261", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "298" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "readOnly": false, - "access": "public", "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1047", - "kind": "streaming", - "name": "SSEStreamSampleEvents", - "valueType": { - "$id": "1048", - "kind": "union", - "name": "SampleEvents", - "variantTypes": [ - { - "$ref": "599" - }, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray.accept", + "methodParameterSegments": [ { - "$ref": "234" + "$id": "1262", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "298" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false } ], - "namespace": "SampleTypeSpec", - "decorators": [], "isExactName": false - }, - "streamKind": "sse", - "contentTypes": [ - "text/event-stream" - ], - "terminalEventValue": "[DONE]", - "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "236" - } } ], - "isErrorResponse": false, - "contentTypes": [ - "text/event-stream" - ], - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/streaming/sse/receive", - "bufferResponse": false, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1046" - } - ], - "response": { - "type": { - "$id": "1049", - "kind": "streaming", - "name": "SSEStreamSampleEvents", - "valueType": { - "$ref": "1048" + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "1248" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/int16-collections/array", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray", + "decorators": [], + "namespace": "SampleTypeSpec" }, - "streamKind": "sse", - "contentTypes": [ - "text/event-stream" + "parameters": [ + { + "$ref": "1262" + } ], - "terminalEventValue": "[DONE]", - "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" - }, - { - "$id": "1050", - "kind": "basic", - "name": "receiveExperimentalJsonLines", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1051", - "name": "receiveExperimentalJsonLines", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "1052", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "response": { "type": { - "$ref": "238" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", - "methodParameterSegments": [ + "$ref": "1248" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray" + }, + { + "$id": "1263", + "kind": "basic", + "name": "getRecord", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1264", + "name": "getRecord", + "isExactName": false, + "resourceName": "Int16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1053", - "kind": "method", + "$id": "1265", + "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "238" + "$ref": "300" }, - "location": "Header", "isApiVersion": false, "optional": false, + "isContentType": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord.accept", + "methodParameterSegments": [ + { + "$id": "1266", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "300" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1054", - "kind": "streaming", - "name": "JsonlStreamPreviewDetails", - "valueType": { - "$ref": "602" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - }, - "headers": [ + "responses": [ { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "240" + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1267", + "kind": "dict", + "keyType": { + "$id": "1268", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1269", + "kind": "int16", + "name": "int16", + "crossLanguageDefinitionId": "TypeSpec.int16", + "decorators": [] + }, + "decorators": [] + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } } } ], - "isErrorResponse": false, - "contentTypes": [ - "application/jsonl" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/experimental/jsonl", - "bufferResponse": false, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1053" - } - ], - "response": { - "type": { - "$id": "1055", - "kind": "streaming", - "name": "JsonlStreamPreviewDetails", - "valueType": { - "$ref": "602" + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/int16-collections/record", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord", + "decorators": [], + "namespace": "SampleTypeSpec" }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" + "parameters": [ + { + "$ref": "1266" + } ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines" - }, - { - "$id": "1056", - "kind": "basic", - "name": "getAcronymParameters", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Send acronym-named path, query, and header parameters.", - "operation": { - "$id": "1057", - "name": "getAcronymParameters", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Send acronym-named path, query, and header parameters.", - "accessibility": "public", - "parameters": [ - { - "$id": "1058", - "kind": "path", - "name": "targetDbName", - "serializedName": "targetDbName", + "response": { "type": { - "$id": "1059", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", - "methodParameterSegments": [ - { - "$id": "1060", - "kind": "method", - "name": "targetDbName", - "serializedName": "targetDbName", + "$ref": "1267" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord" + }, + { + "$id": "1270", + "kind": "basic", + "name": "getNullableArray", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1271", + "name": "getNullableArray", + "isExactName": false, + "resourceName": "Int16Collections", + "accessibility": "public", + "parameters": [ + { + "$id": "1272", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1061", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "302" }, - "location": "Path", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", + "isContentType": false, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray.accept", + "methodParameterSegments": [ + { + "$id": "1273", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "302" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - }, - { - "$id": "1062", - "kind": "query", - "name": "sourceIpAddress", - "serializedName": "sourceIpAddress", - "type": { - "$id": "1063", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", - "readOnly": false, - "methodParameterSegments": [ + "responses": [ { - "$id": "1064", - "kind": "method", - "name": "sourceIpAddress", - "serializedName": "sourceIpAddress", - "type": { - "$id": "1065", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1274", + "kind": "array", + "name": "Array3", + "valueType": { + "$id": "1275", + "kind": "nullable", + "type": { + "$id": "1276", + "kind": "int16", + "name": "int16", + "crossLanguageDefinitionId": "TypeSpec.int16", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "isExactName": false + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/int16-collections/nullable-array", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray", + "decorators": [], + "namespace": "SampleTypeSpec" }, - { - "$id": "1066", - "kind": "header", - "name": "guestOsType", - "serializedName": "X-Guest-OS-Type", + "parameters": [ + { + "$ref": "1273" + } + ], + "response": { "type": { - "$id": "1067", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": true, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", - "methodParameterSegments": [ + "$ref": "1274" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray" + }, + { + "$id": "1277", + "kind": "basic", + "name": "getNullableRecord", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1278", + "name": "getNullableRecord", + "isExactName": false, + "resourceName": "Int16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1068", - "kind": "method", - "name": "guestOsType", - "serializedName": "X-Guest-OS-Type", + "$id": "1279", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1069", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "304" }, - "location": "Header", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", + "optional": false, + "isContentType": false, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord.accept", + "methodParameterSegments": [ + { + "$id": "1280", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "304" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 204 + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1281", + "kind": "dict", + "keyType": { + "$id": "1282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1283", + "kind": "nullable", + "type": { + "$id": "1284", + "kind": "int16", + "name": "int16", + "crossLanguageDefinitionId": "TypeSpec.int16", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/acronyms/{targetDbName}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters", - "decorators": [], - "namespace": "SampleTypeSpec" - }, + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/int16-collections/nullable-record", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1280" + } + ], + "response": { + "type": { + "$ref": "1281" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord" + } + ], "parameters": [ { - "$ref": "1060" - }, - { - "$ref": "1064" - }, - { - "$ref": "1068" + "$id": "1285", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1286", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sampleTypeSpecUrl", + "isExactName": false } ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters" - }, - { - "$id": "1070", - "kind": "basic", - "name": "setAcronymAddresses", - "isExactName": false, - "accessibility": "public", + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Send parameters with leading IP version acronyms.", - "operation": { - "$id": "1071", - "name": "setAcronymAddresses", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Send parameters with leading IP version acronyms.", - "accessibility": "public", - "parameters": [ - { - "$id": "1072", - "kind": "query", - "name": "ipV4Address", - "serializedName": "ipV4Address", - "type": { - "$id": "1073", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", - "readOnly": false, - "methodParameterSegments": [ + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1287", + "kind": "client", + "name": "UInt16Collections", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1288", + "kind": "basic", + "name": "sendNested", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1289", + "name": "sendNested", + "isExactName": false, + "resourceName": "UInt16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1074", - "kind": "method", - "name": "ipV4Address", - "serializedName": "ipV4Address", + "$id": "1290", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "1075", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "306" }, - "location": "Query", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", + "isContentType": true, + "scope": "Constant", "readOnly": false, - "access": "public", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.contentType", + "methodParameterSegments": [ + { + "$id": "1291", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "306" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1076", - "kind": "query", - "name": "ipV6Address", - "serializedName": "ipV6Address", - "type": { - "$id": "1077", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", - "readOnly": false, - "methodParameterSegments": [ + }, { - "$id": "1078", - "kind": "method", - "name": "ipV6Address", - "serializedName": "ipV6Address", + "$id": "1292", + "kind": "body", + "name": "body", + "serializedName": "body", "type": { - "$id": "1079", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "1293", + "kind": "array", + "name": "ArrayArray3", + "valueType": { + "$id": "1294", + "kind": "array", + "name": "Array4", + "valueType": { + "$id": "1295", + "kind": "uint16", + "name": "uint16", + "crossLanguageDefinitionId": "TypeSpec.uint16", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, - "location": "Query", "isApiVersion": false, - "optional": true, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", - "readOnly": false, - "access": "public", "decorators": [], - "isExactName": false + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.body", + "methodParameterSegments": [ + { + "$id": "1296", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "1293" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } } ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 204 + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/acronyms/addresses", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1074" - }, - { - "$ref": "1078" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses" - } - ], - "parameters": [ - { - "$id": "1080", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1081", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.sampleTypeSpecUrl", - "isExactName": false - }, - { - "$ref": "954" - } - ], - "initializedBy": 1, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "children": [ - { - "$id": "1082", - "kind": "client", - "name": "ExperimentalSamples", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/uint16-collections/nested-array", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1296" + }, + { + "$ref": "1291" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested" + }, { - "$id": "1083", + "$id": "1297", "kind": "basic", - "name": "read", + "name": "sendRecord", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -17127,41 +20957,43 @@ "2024-08-16-preview" ], "operation": { - "$id": "1084", - "name": "read", + "$id": "1298", + "name": "sendRecord", "isExactName": false, - "resourceName": "ExperimentalSamples", + "resourceName": "UInt16Collections", "accessibility": "public", "parameters": [ { - "$id": "1085", + "$id": "1299", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "242" + "$ref": "308" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.contentType", "methodParameterSegments": [ { - "$id": "1086", + "$id": "1300", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "242" + "$ref": "308" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -17169,57 +21001,106 @@ } ], "isExactName": false - } - ], - "responses": [ + }, { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "604" + "$id": "1301", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$id": "1302", + "kind": "dict", + "keyType": { + "$id": "1303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "1294" + }, + "decorators": [] }, - "headers": [], - "isErrorResponse": false, + "isApiVersion": false, "contentTypes": [ "application/json" ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.body", + "methodParameterSegments": [ + { + "$id": "1304", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "1302" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, "serializationOptions": { "json": { - "name": "" + "name": "body" } } } ], - "httpMethod": "GET", + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/experimental", + "path": "/uint16-collections/record-of-arrays", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1086" + "$ref": "1304" + }, + { + "$ref": "1300" } ], - "response": { - "type": { - "$ref": "604" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord" }, { - "$id": "1087", - "kind": "paging", - "name": "list", + "$id": "1305", + "kind": "basic", + "name": "getArray", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -17227,19 +21108,19 @@ "2024-08-16-preview" ], "operation": { - "$id": "1088", - "name": "list", + "$id": "1306", + "name": "getArray", "isExactName": false, - "resourceName": "ExperimentalSamples", + "resourceName": "UInt16Collections", "accessibility": "public", "parameters": [ { - "$id": "1089", + "$id": "1307", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "310" }, "isApiVersion": false, "optional": false, @@ -17247,21 +21128,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray.accept", "methodParameterSegments": [ { - "$id": "1090", + "$id": "1308", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "310" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray.accept", "readOnly": false, "access": "public", "decorators": [], @@ -17277,7 +21158,7 @@ 200 ], "bodyType": { - "$ref": "607" + "$ref": "1294" }, "headers": [], "isErrorResponse": false, @@ -17293,224 +21174,82 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/experimental/pages", + "path": "/uint16-collections/array", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1090" + "$ref": "1308" } ], "response": { "type": { - "$ref": "609" - }, - "resultSegments": [ - "items" - ] + "$ref": "1294" + } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", - "pagingMetadata": { - "itemPropertySegments": [ - "items" - ], - "pageSizeParameterSegments": [] - } - } - ], - "parameters": [ - { - "$id": "1091", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1092", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.sampleTypeSpecUrl", - "isExactName": false - } - ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "760" - }, - "isMultiServiceClient": false, - "experimental": { - "diagnosticId": "SAMPLE0009", - "dependsOn": [] - } - }, - { - "$id": "1093", - "kind": "client", - "name": "AnimalOperations", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray" + }, { - "$id": "1094", + "$id": "1309", "kind": "basic", - "name": "updatePetAsAnimal", + "name": "getRecord", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a pet as an animal", - "operation": { - "$id": "1095", - "name": "updatePetAsAnimal", - "isExactName": false, - "resourceName": "AnimalOperations", - "doc": "Update a pet as an animal", - "accessibility": "public", - "parameters": [ - { - "$id": "1096", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "246" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", - "methodParameterSegments": [ - { - "$id": "1097", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "246" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1098", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "248" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", - "methodParameterSegments": [ - { - "$id": "1099", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "248" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, + "2024-08-16-preview" + ], + "operation": { + "$id": "1310", + "name": "getRecord", + "isExactName": false, + "resourceName": "UInt16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1100", - "kind": "body", - "name": "animal", - "serializedName": "animal", + "$id": "1311", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "610" + "$ref": "312" }, "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, - "scope": "Method", - "decorators": [], + "isContentType": false, + "scope": "Constant", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord.accept", "methodParameterSegments": [ { - "$id": "1101", + "$id": "1312", "kind": "method", - "name": "animal", - "serializedName": "animal", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "610" + "$ref": "312" }, - "location": "Body", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord.accept", "readOnly": false, "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "animal" - } - } + "isExactName": false } ], "responses": [ @@ -17519,7 +21258,23 @@ 200 ], "bodyType": { - "$ref": "610" + "$id": "1313", + "kind": "dict", + "keyType": { + "$id": "1314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1315", + "kind": "uint16", + "name": "uint16", + "crossLanguageDefinitionId": "TypeSpec.uint16", + "decorators": [] + }, + "decorators": [] }, "headers": [], "isErrorResponse": false, @@ -17533,90 +21288,77 @@ } } ], - "httpMethod": "PUT", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/animals/pet/as-animal", - "requestMediaTypes": [ - "application/json" - ], + "path": "/uint16-collections/record", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1101" - }, - { - "$ref": "1097" - }, - { - "$ref": "1099" + "$ref": "1312" } ], "response": { "type": { - "$ref": "610" + "$ref": "1313" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord" }, { - "$id": "1102", + "$id": "1316", "kind": "basic", - "name": "updateDogAsAnimal", + "name": "getNullableArray", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update a dog as an animal", "operation": { - "$id": "1103", - "name": "updateDogAsAnimal", + "$id": "1317", + "name": "getNullableArray", "isExactName": false, - "resourceName": "AnimalOperations", - "doc": "Update a dog as an animal", + "resourceName": "UInt16Collections", "accessibility": "public", "parameters": [ { - "$id": "1104", + "$id": "1318", "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "250" + "$ref": "314" }, "isApiVersion": false, "optional": false, - "isContentType": true, + "isContentType": false, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray.accept", "methodParameterSegments": [ { - "$id": "1105", + "$id": "1319", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "250" + "$ref": "314" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray.accept", "readOnly": false, "access": "public", "decorators": [], @@ -17624,14 +21366,93 @@ } ], "isExactName": false - }, + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1320", + "kind": "array", + "name": "Array5", + "valueType": { + "$id": "1321", + "kind": "nullable", + "type": { + "$id": "1322", + "kind": "uint16", + "name": "uint16", + "crossLanguageDefinitionId": "TypeSpec.uint16", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/uint16-collections/nullable-array", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1319" + } + ], + "response": { + "type": { + "$ref": "1320" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray" + }, + { + "$id": "1323", + "kind": "basic", + "name": "getNullableRecord", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1324", + "name": "getNullableRecord", + "isExactName": false, + "resourceName": "UInt16Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1106", + "$id": "1325", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "316" }, "isApiVersion": false, "optional": false, @@ -17639,21 +21460,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord.accept", "methodParameterSegments": [ { - "$id": "1107", + "$id": "1326", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "316" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord.accept", "readOnly": false, "access": "public", "decorators": [], @@ -17661,51 +21482,6 @@ } ], "isExactName": false - }, - { - "$id": "1108", - "kind": "body", - "name": "animal", - "serializedName": "animal", - "type": { - "$ref": "610" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", - "methodParameterSegments": [ - { - "$id": "1109", - "kind": "method", - "name": "animal", - "serializedName": "animal", - "type": { - "$ref": "610" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "animal" - } - } } ], "responses": [ @@ -17714,7 +21490,28 @@ 200 ], "bodyType": { - "$ref": "610" + "$id": "1327", + "kind": "dict", + "keyType": { + "$id": "1328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1329", + "kind": "nullable", + "type": { + "$id": "1330", + "kind": "uint16", + "name": "uint16", + "crossLanguageDefinitionId": "TypeSpec.uint16", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] }, "headers": [], "isErrorResponse": false, @@ -17728,49 +21525,40 @@ } } ], - "httpMethod": "PUT", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/animals/dog/as-animal", - "requestMediaTypes": [ - "application/json" - ], + "path": "/uint16-collections/nullable-record", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1109" - }, - { - "$ref": "1105" - }, - { - "$ref": "1107" + "$ref": "1326" } ], "response": { "type": { - "$ref": "610" + "$ref": "1327" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord" } ], "parameters": [ { - "$id": "1110", + "$id": "1331", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1111", + "$id": "1332", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17782,116 +21570,77 @@ "serverUrlTemplate": "{sampleTypeSpecUrl}", "skipUrlEncoding": false, "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.sampleTypeSpecUrl", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sampleTypeSpecUrl", "isExactName": false } ], "initializedBy": 0, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "parent": { - "$ref": "760" + "$ref": "808" }, "isMultiServiceClient": false }, { - "$id": "1112", + "$id": "1333", "kind": "client", - "name": "PetOperations", + "name": "UInt32Collections", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1113", + "$id": "1334", "kind": "basic", - "name": "updatePetAsPet", + "name": "sendNested", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update a pet as a pet", "operation": { - "$id": "1114", - "name": "updatePetAsPet", + "$id": "1335", + "name": "sendNested", "isExactName": false, - "resourceName": "PetOperations", - "doc": "Update a pet as a pet", + "resourceName": "UInt32Collections", "accessibility": "public", "parameters": [ { - "$id": "1115", + "$id": "1336", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "254" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", - "methodParameterSegments": [ - { - "$id": "1116", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "254" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1117", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "256" + "$ref": "318" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.contentType", "methodParameterSegments": [ { - "$id": "1118", + "$id": "1337", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "256" + "$ref": "318" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -17901,12 +21650,30 @@ "isExactName": false }, { - "$id": "1119", + "$id": "1338", "kind": "body", - "name": "pet", - "serializedName": "pet", + "name": "body", + "serializedName": "body", "type": { - "$ref": "615" + "$id": "1339", + "kind": "array", + "name": "ArrayArray4", + "valueType": { + "$id": "1340", + "kind": "array", + "name": "Array6", + "valueType": { + "$id": "1341", + "kind": "uint32", + "name": "uint32", + "crossLanguageDefinitionId": "TypeSpec.uint32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, "isApiVersion": false, "contentTypes": [ @@ -17917,21 +21684,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.body", "methodParameterSegments": [ { - "$id": "1120", + "$id": "1342", "kind": "method", - "name": "pet", - "serializedName": "pet", + "name": "body", + "serializedName": "body", "type": { - "$ref": "615" + "$ref": "1339" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.body", "readOnly": false, "access": "public", "decorators": [], @@ -17941,7 +21708,7 @@ "isExactName": false, "serializationOptions": { "json": { - "name": "pet" + "name": "body" } } } @@ -17949,84 +21716,65 @@ "responses": [ { "statusCodes": [ - 200 + 204 ], - "bodyType": { - "$ref": "615" - }, "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], - "httpMethod": "PUT", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/pets/pet/as-pet", + "path": "/uint32-collections/nested-array", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1120" - }, - { - "$ref": "1116" + "$ref": "1342" }, { - "$ref": "1118" + "$ref": "1337" } ], - "response": { - "type": { - "$ref": "615" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested" }, { - "$id": "1121", + "$id": "1343", "kind": "basic", - "name": "updateDogAsPet", + "name": "sendRecord", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update a dog as a pet", "operation": { - "$id": "1122", - "name": "updateDogAsPet", + "$id": "1344", + "name": "sendRecord", "isExactName": false, - "resourceName": "PetOperations", - "doc": "Update a dog as a pet", + "resourceName": "UInt32Collections", "accessibility": "public", "parameters": [ { - "$id": "1123", + "$id": "1345", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "258" + "$ref": "320" }, "isApiVersion": false, "optional": false, @@ -18034,59 +21782,22 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.contentType", "methodParameterSegments": [ { - "$id": "1124", + "$id": "1346", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "258" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1125", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "260" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", - "methodParameterSegments": [ - { - "$id": "1126", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "260" + "$ref": "320" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -18096,12 +21807,24 @@ "isExactName": false }, { - "$id": "1127", + "$id": "1347", "kind": "body", - "name": "pet", - "serializedName": "pet", + "name": "body", + "serializedName": "body", "type": { - "$ref": "615" + "$id": "1348", + "kind": "dict", + "keyType": { + "$id": "1349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "1340" + }, + "decorators": [] }, "isApiVersion": false, "contentTypes": [ @@ -18112,21 +21835,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.body", "methodParameterSegments": [ { - "$id": "1128", + "$id": "1350", "kind": "method", - "name": "pet", - "serializedName": "pet", + "name": "body", + "serializedName": "body", "type": { - "$ref": "615" + "$ref": "1348" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.body", "readOnly": false, "access": "public", "decorators": [], @@ -18136,7 +21859,7 @@ "isExactName": false, "serializationOptions": { "json": { - "name": "pet" + "name": "body" } } } @@ -18144,165 +21867,64 @@ "responses": [ { "statusCodes": [ - 200 + 204 ], - "bodyType": { - "$ref": "615" - }, "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], - "httpMethod": "PUT", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/pets/dog/as-pet", + "path": "/uint32-collections/record-of-arrays", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1128" - }, - { - "$ref": "1124" + "$ref": "1350" }, { - "$ref": "1126" + "$ref": "1346" } ], - "response": { - "type": { - "$ref": "615" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet" - } - ], - "parameters": [ - { - "$id": "1129", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1130", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.sampleTypeSpecUrl", - "isExactName": false - } - ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "760" - }, - "isMultiServiceClient": false - }, - { - "$id": "1131", - "kind": "client", - "name": "DogOperations", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord" + }, { - "$id": "1132", + "$id": "1351", "kind": "basic", - "name": "updateDogAsDog", + "name": "getArray", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update a dog as a dog", "operation": { - "$id": "1133", - "name": "updateDogAsDog", + "$id": "1352", + "name": "getArray", "isExactName": false, - "resourceName": "DogOperations", - "doc": "Update a dog as a dog", + "resourceName": "UInt32Collections", "accessibility": "public", "parameters": [ { - "$id": "1134", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "262" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", - "methodParameterSegments": [ - { - "$id": "1135", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "262" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1136", + "$id": "1353", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "264" + "$ref": "322" }, "isApiVersion": false, "optional": false, @@ -18310,21 +21932,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray.accept", "methodParameterSegments": [ { - "$id": "1137", + "$id": "1354", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "264" + "$ref": "322" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray.accept", "readOnly": false, "access": "public", "decorators": [], @@ -18332,51 +21954,6 @@ } ], "isExactName": false - }, - { - "$id": "1138", - "kind": "body", - "name": "dog", - "serializedName": "dog", - "type": { - "$ref": "619" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", - "methodParameterSegments": [ - { - "$id": "1139", - "kind": "method", - "name": "dog", - "serializedName": "dog", - "type": { - "$ref": "619" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "dog" - } - } } ], "responses": [ @@ -18385,7 +21962,7 @@ 200 ], "bodyType": { - "$ref": "619" + "$ref": "1340" }, "headers": [], "isErrorResponse": false, @@ -18399,109 +21976,55 @@ } } ], - "httpMethod": "PUT", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/dogs/dog/as-dog", - "requestMediaTypes": [ - "application/json" - ], + "path": "/uint32-collections/array", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1139" - }, - { - "$ref": "1135" - }, - { - "$ref": "1137" + "$ref": "1354" } ], "response": { "type": { - "$ref": "619" + "$ref": "1340" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog" - } - ], - "parameters": [ - { - "$id": "1140", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1141", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.sampleTypeSpecUrl", - "isExactName": false - } - ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "760" - }, - "isMultiServiceClient": false - }, - { - "$id": "1142", - "kind": "client", - "name": "PlantOperations", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray" + }, { - "$id": "1143", + "$id": "1355", "kind": "basic", - "name": "getTree", + "name": "getRecord", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Get a tree as a plant", "operation": { - "$id": "1144", - "name": "getTree", + "$id": "1356", + "name": "getRecord", "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Get a tree as a plant", + "resourceName": "UInt32Collections", "accessibility": "public", "parameters": [ { - "$id": "1145", + "$id": "1357", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "266" + "$ref": "324" }, "isApiVersion": false, "optional": false, @@ -18509,21 +22032,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord.accept", "methodParameterSegments": [ { - "$id": "1146", + "$id": "1358", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "266" + "$ref": "324" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord.accept", "readOnly": false, "access": "public", "decorators": [], @@ -18539,23 +22062,31 @@ 200 ], "bodyType": { - "$ref": "623" + "$id": "1359", + "kind": "dict", + "keyType": { + "$id": "1360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1361", + "kind": "uint32", + "name": "uint32", + "crossLanguageDefinitionId": "TypeSpec.uint32", + "decorators": [] + }, + "decorators": [] }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "268" - } - } - ], + "headers": [], "isErrorResponse": false, "contentTypes": [ - "application/xml" + "application/json" ], "serializationOptions": { - "xml": { + "json": { "name": "" } } @@ -18563,55 +22094,53 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant", + "path": "/uint32-collections/record", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1146" + "$ref": "1358" } ], "response": { "type": { - "$ref": "623" + "$ref": "1359" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord" }, { - "$id": "1147", + "$id": "1362", "kind": "basic", - "name": "getTreeAsJson", + "name": "getNullableArray", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Get a tree as a plant", "operation": { - "$id": "1148", - "name": "getTreeAsJson", + "$id": "1363", + "name": "getNullableArray", "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Get a tree as a plant", + "resourceName": "UInt32Collections", "accessibility": "public", "parameters": [ { - "$id": "1149", + "$id": "1364", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "270" + "$ref": "326" }, "isApiVersion": false, "optional": false, @@ -18619,21 +22148,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray.accept", "methodParameterSegments": [ { - "$id": "1150", + "$id": "1365", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "270" + "$ref": "326" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray.accept", "readOnly": false, "access": "public", "decorators": [], @@ -18649,17 +22178,25 @@ 200 ], "bodyType": { - "$ref": "623" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", + "$id": "1366", + "kind": "array", + "name": "Array7", + "valueType": { + "$id": "1367", + "kind": "nullable", "type": { - "$ref": "272" - } - } - ], + "$id": "1368", + "kind": "uint32", + "name": "uint32", + "crossLanguageDefinitionId": "TypeSpec.uint32", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "headers": [], "isErrorResponse": false, "contentTypes": [ "application/json" @@ -18673,77 +22210,75 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant/json", + "path": "/uint32-collections/nullable-array", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1150" + "$ref": "1365" } ], "response": { "type": { - "$ref": "623" + "$ref": "1366" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray" }, { - "$id": "1151", + "$id": "1369", "kind": "basic", - "name": "updateTree", + "name": "getNullableRecord", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update a tree as a plant", "operation": { - "$id": "1152", - "name": "updateTree", + "$id": "1370", + "name": "getNullableRecord", "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Update a tree as a plant", + "resourceName": "UInt32Collections", "accessibility": "public", "parameters": [ { - "$id": "1153", + "$id": "1371", "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "274" + "$ref": "328" }, "isApiVersion": false, "optional": false, - "isContentType": true, + "isContentType": false, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord.accept", "methodParameterSegments": [ { - "$id": "1154", + "$id": "1372", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "274" + "$ref": "328" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord.accept", "readOnly": false, "access": "public", "decorators": [], @@ -18751,36 +22286,165 @@ } ], "isExactName": false - }, + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1373", + "kind": "dict", + "keyType": { + "$id": "1374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1375", + "kind": "nullable", + "type": { + "$id": "1376", + "kind": "uint32", + "name": "uint32", + "crossLanguageDefinitionId": "TypeSpec.uint32", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/uint32-collections/nullable-record", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1372" + } + ], + "response": { + "type": { + "$ref": "1373" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord" + } + ], + "parameters": [ + { + "$id": "1377", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1378", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sampleTypeSpecUrl", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "808" + }, + "isMultiServiceClient": false + }, + { + "$id": "1379", + "kind": "client", + "name": "UInt64Collections", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1380", + "kind": "basic", + "name": "sendNested", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1381", + "name": "sendNested", + "isExactName": false, + "resourceName": "UInt64Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1155", + "$id": "1382", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "278" + "$ref": "330" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.contentType", "methodParameterSegments": [ { - "$id": "1156", + "$id": "1383", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "278" + "$ref": "330" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -18790,37 +22454,55 @@ "isExactName": false }, { - "$id": "1157", + "$id": "1384", "kind": "body", - "name": "tree", - "serializedName": "tree", + "name": "body", + "serializedName": "body", "type": { - "$ref": "623" + "$id": "1385", + "kind": "array", + "name": "ArrayArray5", + "valueType": { + "$id": "1386", + "kind": "array", + "name": "Array8", + "valueType": { + "$id": "1387", + "kind": "uint64", + "name": "uint64", + "crossLanguageDefinitionId": "TypeSpec.uint64", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, "isApiVersion": false, "contentTypes": [ - "application/xml" + "application/json" ], - "defaultContentType": "application/xml", + "defaultContentType": "application/json", "optional": false, "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.body", "methodParameterSegments": [ { - "$id": "1158", + "$id": "1388", "kind": "method", - "name": "tree", - "serializedName": "tree", + "name": "body", + "serializedName": "body", "type": { - "$ref": "623" + "$ref": "1385" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.body", "readOnly": false, "access": "public", "decorators": [], @@ -18829,8 +22511,8 @@ ], "isExactName": false, "serializationOptions": { - "xml": { - "name": "tree" + "json": { + "name": "body" } } } @@ -18838,91 +22520,65 @@ "responses": [ { "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "623" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "280" - } - } + 204 ], + "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/xml" - ], - "serializationOptions": { - "xml": { - "name": "" - } - } + "serializationOptions": {} } ], - "httpMethod": "PUT", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant", + "path": "/uint64-collections/nested-array", "requestMediaTypes": [ - "application/xml" + "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1158" + "$ref": "1388" }, { - "$ref": "1154" - }, - { - "$ref": "1156" + "$ref": "1383" } ], - "response": { - "type": { - "$ref": "623" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested" }, { - "$id": "1159", + "$id": "1389", "kind": "basic", - "name": "updateTreeAsJson", + "name": "sendRecord", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update a tree as a plant", "operation": { - "$id": "1160", - "name": "updateTreeAsJson", + "$id": "1390", + "name": "sendRecord", "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Update a tree as a plant", + "resourceName": "UInt64Collections", "accessibility": "public", "parameters": [ { - "$id": "1161", + "$id": "1391", "kind": "header", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "282" + "$ref": "332" }, "isApiVersion": false, "optional": false, @@ -18930,58 +22586,22 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.contentType", "methodParameterSegments": [ { - "$id": "1162", + "$id": "1392", "kind": "method", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "282" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1163", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "286" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", - "methodParameterSegments": [ - { - "$id": "1164", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "286" + "$ref": "332" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -18991,12 +22611,24 @@ "isExactName": false }, { - "$id": "1165", + "$id": "1393", "kind": "body", - "name": "tree", - "serializedName": "tree", + "name": "body", + "serializedName": "body", "type": { - "$ref": "623" + "$id": "1394", + "kind": "dict", + "keyType": { + "$id": "1395", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "1386" + }, + "decorators": [] }, "isApiVersion": false, "contentTypes": [ @@ -19007,21 +22639,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.body", "methodParameterSegments": [ { - "$id": "1166", + "$id": "1396", "kind": "method", - "name": "tree", - "serializedName": "tree", + "name": "body", + "serializedName": "body", "type": { - "$ref": "623" + "$ref": "1394" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.body", "readOnly": false, "access": "public", "decorators": [], @@ -19031,7 +22663,7 @@ "isExactName": false, "serializationOptions": { "json": { - "name": "tree" + "name": "body" } } } @@ -19039,207 +22671,86 @@ "responses": [ { "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "623" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "288" - } - } + 204 ], + "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], - "httpMethod": "PUT", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant/json", + "path": "/uint64-collections/record-of-arrays", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1166" - }, - { - "$ref": "1162" + "$ref": "1396" }, { - "$ref": "1164" + "$ref": "1392" } ], - "response": { - "type": { - "$ref": "623" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson" - } - ], - "parameters": [ - { - "$id": "1167", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1168", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.sampleTypeSpecUrl", - "isExactName": false - } - ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "760" - }, - "isMultiServiceClient": false - }, - { - "$id": "1169", - "kind": "client", - "name": "Metrics", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord" + }, { - "$id": "1170", + "$id": "1397", "kind": "basic", - "name": "getWidgetMetrics", + "name": "getArray", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1171", - "name": "getWidgetMetrics", + "$id": "1398", + "name": "getArray", "isExactName": false, - "resourceName": "Metrics", - "doc": "Get Widget metrics for given day of week", + "resourceName": "UInt64Collections", "accessibility": "public", "parameters": [ { - "$id": "1172", - "kind": "path", - "name": "metricsNamespace", - "serializedName": "metricsNamespace", - "type": { - "$id": "1173", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", - "methodParameterSegments": [ - { - "$id": "1174", - "kind": "method", - "name": "metricsNamespace", - "serializedName": "metricsNamespace", - "type": { - "$id": "1175", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1176", - "kind": "path", - "name": "day", - "serializedName": "day", + "$id": "1399", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "87" + "$ref": "334" }, "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Method", - "decorators": [], + "optional": false, + "isContentType": false, + "scope": "Constant", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray.accept", "methodParameterSegments": [ { - "$id": "1177", + "$id": "1400", "kind": "method", - "name": "day", - "serializedName": "day", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "87" + "$ref": "334" }, - "location": "Path", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray.accept", "readOnly": false, "access": "public", "decorators": [], @@ -19247,14 +22758,77 @@ } ], "isExactName": false - }, + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "1386" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/uint64-collections/array", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1400" + } + ], + "response": { + "type": { + "$ref": "1386" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray" + }, + { + "$id": "1401", + "kind": "basic", + "name": "getRecord", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1402", + "name": "getRecord", + "isExactName": false, + "resourceName": "UInt64Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1178", + "$id": "1403", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "290" + "$ref": "336" }, "isApiVersion": false, "optional": false, @@ -19262,21 +22836,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord.accept", "methodParameterSegments": [ { - "$id": "1179", + "$id": "1404", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "290" + "$ref": "336" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord.accept", "readOnly": false, "access": "public", "decorators": [], @@ -19292,7 +22866,23 @@ 200 ], "bodyType": { - "$ref": "639" + "$id": "1405", + "kind": "dict", + "keyType": { + "$id": "1406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1407", + "kind": "uint64", + "name": "uint64", + "crossLanguageDefinitionId": "TypeSpec.uint64", + "decorators": [] + }, + "decorators": [] }, "headers": [], "isErrorResponse": false, @@ -19308,153 +22898,169 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", + "path": "/uint64-collections/record", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1177" - }, - { - "$ref": "1179" + "$ref": "1404" } ], "response": { "type": { - "$ref": "639" + "$ref": "1405" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics" - } - ], - "parameters": [ - { - "$id": "1180", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1181", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl", - "isExactName": false + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord" }, { - "$ref": "1174" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "760" - }, - "isMultiServiceClient": false - }, - { - "$id": "1182", - "kind": "client", - "name": "Notebooks", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1183", + "$id": "1408", "kind": "basic", - "name": "getNotebook", + "name": "getNullableArray", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Get a notebook by name", "operation": { - "$id": "1184", - "name": "getNotebook", + "$id": "1409", + "name": "getNullableArray", "isExactName": false, - "resourceName": "Notebooks", - "doc": "Get a notebook by name", + "resourceName": "UInt64Collections", "accessibility": "public", "parameters": [ { - "$id": "1185", - "kind": "path", - "name": "notebookName", - "serializedName": "notebookName", + "$id": "1410", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1186", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "338" }, "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, "optional": false, - "scope": "Client", - "decorators": [], + "isContentType": false, + "scope": "Constant", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray.accept", "methodParameterSegments": [ { - "$id": "1187", + "$id": "1411", "kind": "method", - "name": "notebook", - "serializedName": "notebook", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1188", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "338" }, - "location": "", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.NotebookClientParams.notebook", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray.accept", "readOnly": false, "access": "public", "decorators": [], - "paramAlias": "notebookName", "isExactName": false } ], "isExactName": false - }, + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1412", + "kind": "array", + "name": "Array9", + "valueType": { + "$id": "1413", + "kind": "nullable", + "type": { + "$id": "1414", + "kind": "uint64", + "name": "uint64", + "crossLanguageDefinitionId": "TypeSpec.uint64", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/uint64-collections/nullable-array", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1411" + } + ], + "response": { + "type": { + "$ref": "1412" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray" + }, + { + "$id": "1415", + "kind": "basic", + "name": "getNullableRecord", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1416", + "name": "getNullableRecord", + "isExactName": false, + "resourceName": "UInt64Collections", + "accessibility": "public", + "parameters": [ { - "$id": "1189", + "$id": "1417", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "292" + "$ref": "340" }, "isApiVersion": false, "optional": false, @@ -19462,21 +23068,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord.accept", "methodParameterSegments": [ { - "$id": "1190", + "$id": "1418", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "292" + "$ref": "340" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord.accept", "readOnly": false, "access": "public", "decorators": [], @@ -19492,7 +23098,28 @@ 200 ], "bodyType": { - "$ref": "644" + "$id": "1419", + "kind": "dict", + "keyType": { + "$id": "1420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1421", + "kind": "nullable", + "type": { + "$id": "1422", + "kind": "uint64", + "name": "uint64", + "crossLanguageDefinitionId": "TypeSpec.uint64", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "decorators": [] }, "headers": [], "isErrorResponse": false, @@ -19508,38 +23135,38 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/notebooks/{notebookName}", + "path": "/uint64-collections/nullable-record", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1190" + "$ref": "1418" } ], "response": { "type": { - "$ref": "644" + "$ref": "1419" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook" + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord" } ], "parameters": [ { - "$id": "1191", + "$id": "1423", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1192", + "$id": "1424", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -19551,22 +23178,19 @@ "serverUrlTemplate": "{sampleTypeSpecUrl}", "skipUrlEncoding": false, "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.sampleTypeSpecUrl", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sampleTypeSpecUrl", "isExactName": false - }, - { - "$ref": "1187" } ], - "initializedBy": 3, + "initializedBy": 0, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks", + "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "parent": { - "$ref": "760" + "$ref": "808" }, "isMultiServiceClient": false } From 833a3507560436aa8c8d2947db7d0ec4b004b93d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:34:44 +0000 Subject: [PATCH 3/7] test(http-client-csharp): replace integer collection fixtures with generator baselines Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../ScmMethodProviderCollectionTests.cs | 34 + ...ectionResponsesUseUtf8JsonReader(Int16).cs | 120 + ...ctionResponsesUseUtf8JsonReader(UInt16).cs | 120 + ...ctionResponsesUseUtf8JsonReader(UInt32).cs | 120 + ...ctionResponsesUseUtf8JsonReader(UInt64).cs | 120 + .../Local.Tests/IntegerCollectionTests.cs | 165 - .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 38 - .../Generated/Int16Collections.RestClient.cs | 97 - .../src/Generated/Int16Collections.cs | 488 - .../src/Generated/SampleTypeSpecClient.cs | 28 - .../Generated/UInt16Collections.RestClient.cs | 97 - .../src/Generated/UInt16Collections.cs | 488 - .../Generated/UInt32Collections.RestClient.cs | 97 - .../src/Generated/UInt32Collections.cs | 488 - .../Generated/UInt64Collections.RestClient.cs | 97 - .../src/Generated/UInt64Collections.cs | 488 - .../Local/Sample-TypeSpec/tspCodeModel.json | 18040 ++++++---------- 17 files changed, 7722 insertions(+), 13403 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 688f69be6f7..dcd4e2a81b4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -2528,6 +2528,40 @@ public void ListMethodIsRenamedToGet() } } + [TestCase(InputPrimitiveTypeKind.Int16)] + [TestCase(InputPrimitiveTypeKind.UInt16)] + [TestCase(InputPrimitiveTypeKind.UInt32)] + [TestCase(InputPrimitiveTypeKind.UInt64)] + public void IntegerCollectionResponsesUseUtf8JsonReader(InputPrimitiveTypeKind kind) + { + MockHelpers.LoadMockGenerator(); + var generatedCode = new StringBuilder(); + foreach (var isDictionary in new[] { false, true }) + { + foreach (var isNullable in new[] { false, true }) + { + InputType elementType = new InputPrimitiveType(kind, kind.ToString(), $"TypeSpec.{kind.ToString().ToLowerInvariant()}"); + if (isNullable) + { + elementType = new InputNullableType(elementType); + } + var responseType = isDictionary ? (InputType)InputFactory.Dictionary(elementType) : InputFactory.Array(elementType); + var name = $"Get{(isNullable ? "Nullable" : "")}{(isDictionary ? "Dictionary" : "List")}"; + var operation = InputFactory.Operation(name, responses: [InputFactory.OperationResponse([200], responseType)]); + var serviceMethod = InputFactory.BasicServiceMethod(name, operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient)!; + var methods = new ScmMethodProviderCollection(serviceMethod, client); + foreach (var method in methods.Where(m => m.Kind == ScmMethodKind.Convenience)) + { + generatedCode.Append(method.BodyStatements!.ToDisplayString()); + } + } + } + + Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), generatedCode.ToString()); + } + [TestCase(typeof(int))] [TestCase(typeof(int), true)] [TestCase(typeof(int?))] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs new file mode 100644 index 00000000000..9a7522546fe --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs @@ -0,0 +1,120 @@ +global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs new file mode 100644 index 00000000000..c18855ecc79 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs @@ -0,0 +1,120 @@ +global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs new file mode 100644 index 00000000000..af09776ac91 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs @@ -0,0 +1,120 @@ +global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs new file mode 100644 index 00000000000..2044c782d0e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs @@ -0,0 +1,120 @@ +global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); +global::System.BinaryData data = result.GetRawResponse().Content; +global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); +jsonReader.Read(); +while (jsonReader.Read()) +{ + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); +} +return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs deleted file mode 100644 index a78a01dde46..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/IntegerCollectionTests.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using NUnit.Framework; -using SampleTypeSpec; - -namespace TestProjects.Local.Tests -{ - public class IntegerCollectionTests - { - [Test] - public Task Int16Collections( - [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, - [Values(false, true)] bool isAsync) - { - var handler = new CollectionHandler(); - var client = new Int16Collections(CreatePipeline(handler), new Uri("https://example.com")); - return VerifyCollections(handler, shape, [short.MinValue, 0, short.MaxValue], "-32768,0,32767", "32768", - body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), - body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), - () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), - () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), - () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), - () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); - } - - [Test] - public Task UInt16Collections( - [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, - [Values(false, true)] bool isAsync) - { - var handler = new CollectionHandler(); - var client = new UInt16Collections(CreatePipeline(handler), new Uri("https://example.com")); - return VerifyCollections(handler, shape, [0, 1, ushort.MaxValue], "0,1,65535", "-1", - body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), - body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), - () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), - () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), - () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), - () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); - } - - [Test] - public Task UInt32Collections( - [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, - [Values(false, true)] bool isAsync) - { - var handler = new CollectionHandler(); - var client = new UInt32Collections(CreatePipeline(handler), new Uri("https://example.com")); - return VerifyCollections(handler, shape, [0, 1, uint.MaxValue], "0,1,4294967295", "-1", - body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), - body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), - () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), - () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), - () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), - () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); - } - - [Test] - public Task UInt64Collections( - [Values("nested", "record-of-arrays", "array", "record", "nullable-array", "nullable-record")] string shape, - [Values(false, true)] bool isAsync) - { - var handler = new CollectionHandler(); - var client = new UInt64Collections(CreatePipeline(handler), new Uri("https://example.com")); - return VerifyCollections(handler, shape, [0, 1, ulong.MaxValue], "0,1,18446744073709551615", "-1", - body => isAsync ? client.SendNestedAsync(body) : Task.FromResult(client.SendNested(body)), - body => isAsync ? client.SendRecordAsync(body) : Task.FromResult(client.SendRecord(body)), - () => isAsync ? client.GetArrayAsync() : Task.FromResult(client.GetArray()), - () => isAsync ? client.GetRecordAsync() : Task.FromResult(client.GetRecord()), - () => isAsync ? client.GetNullableArrayAsync() : Task.FromResult(client.GetNullableArray()), - () => isAsync ? client.GetNullableRecordAsync() : Task.FromResult(client.GetNullableRecord())); - } - - private static async Task VerifyCollections( - CollectionHandler handler, string shape, T[] values, string numbers, string invalidNumber, - Func>, Task> sendNested, - Func>, Task> sendRecord, - Func>>> getArray, - Func>>> getRecord, - Func>>> getNullableArray, - Func>>> getNullableRecord) where T : struct - { - using (handler) - { - switch (shape) - { - case "nested": - await sendNested([new List(values), Array.Empty()]); - Assert.AreEqual($"[[{numbers}],[]]", handler.RequestBody); - break; - case "record-of-arrays": - await sendRecord(new Dictionary> { ["numbers"] = values, ["empty"] = new List() }); - Assert.AreEqual($"{{\"numbers\":[{numbers}],\"empty\":[]}}", handler.RequestBody); - break; - case "array": - handler.ResponseBody = $"[{numbers}]"; - CollectionAssert.AreEqual(values, (await getArray()).Value); - handler.ResponseBody = "[]"; - Assert.IsEmpty((await getArray()).Value); - handler.ResponseBody = $"[{invalidNumber}]"; - Assert.ThrowsAsync(async () => await getArray()); - break; - case "record": - handler.ResponseBody = $"{{\"first\":{numbers.Split(',')[0]},\"last\":{numbers.Split(',')[2]}}}"; - var record = (await getRecord()).Value; - Assert.AreEqual(2, record.Count); - Assert.AreEqual(values[0], record["first"]); - Assert.AreEqual(values[2], record["last"]); - handler.ResponseBody = "{}"; - Assert.IsEmpty((await getRecord()).Value); - handler.ResponseBody = $"{{\"invalid\":{invalidNumber}}}"; - Assert.ThrowsAsync(async () => await getRecord()); - break; - case "nullable-array": - handler.ResponseBody = $"[null,{numbers},null]"; - CollectionAssert.AreEqual(new T?[] { null }.Concat(values.Select(v => (T?)v)).Append(null), (await getNullableArray()).Value); - break; - case "nullable-record": - handler.ResponseBody = $"{{\"first\":{numbers.Split(',')[0]},\"missing\":null,\"last\":{numbers.Split(',')[2]}}}"; - var nullableRecord = (await getNullableRecord()).Value; - Assert.AreEqual(3, nullableRecord.Count); - Assert.AreEqual(values[0], nullableRecord["first"]); - Assert.IsNull(nullableRecord["missing"]); - Assert.AreEqual(values[2], nullableRecord["last"]); - break; - default: - Assert.Fail($"Unexpected collection shape: {shape}"); - break; - } - } - } - - private static ClientPipeline CreatePipeline(CollectionHandler handler) - => ClientPipeline.Create(new ClientPipelineOptions { Transport = new HttpClientPipelineTransport(new HttpClient(handler)) }); - - private sealed class CollectionHandler : HttpMessageHandler - { - public string? RequestBody { get; private set; } - public string ResponseBody { get; set; } = "{}"; - - protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) - { - RequestBody = request.Content?.ReadAsStringAsync(cancellationToken).GetAwaiter().GetResult(); - return new HttpResponseMessage(request.Method == HttpMethod.Post ? HttpStatusCode.NoContent : HttpStatusCode.OK) - { - Content = new StringContent(ResponseBody, Encoding.UTF8, "application/json") - }; - } - - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - => Task.FromResult(Send(request, cancellationToken)); - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 4ebae1d1427..8c4ec4b4b74 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -1130,41 +1130,3 @@ op getAcronymParameters( @post @convenientAPI(true, "csharp") op setAcronymAddresses(@query ipV4Address: string, @query ipV6Address?: string): void; - -interface IntegerCollections { - @route("/nested-array") - @post - sendNested(@body body: T[][]): void; - - @route("/record-of-arrays") - @post - sendRecord(@body body: Record): void; - - @route("/array") - @get - getArray(): T[]; - - @route("/record") - @get - getRecord(): Record; - - @route("/nullable-array") - @get - getNullableArray(): (T | null)[]; - - @route("/nullable-record") - @get - getNullableRecord(): Record; -} - -@route("/int16-collections") -interface Int16Collections extends IntegerCollections {} - -@route("/uint16-collections") -interface UInt16Collections extends IntegerCollections {} - -@route("/uint32-collections") -interface UInt32Collections extends IntegerCollections {} - -@route("/uint64-collections") -interface UInt64Collections extends IntegerCollections {} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs deleted file mode 100644 index 6759cc8dd2b..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.RestClient.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; - -namespace SampleTypeSpec -{ - /// - public partial class Int16Collections - { - private static PipelineMessageClassifier _pipelineMessageClassifier200; - private static PipelineMessageClassifier _pipelineMessageClassifier204; - - private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); - - private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); - - internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int16-collections/nested-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int16-collections/record-of-arrays", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int16-collections/array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int16-collections/record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int16-collections/nullable-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int16-collections/nullable-record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs deleted file mode 100644 index 8e078f83832..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Int16Collections.cs +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; - -namespace SampleTypeSpec -{ - /// The Int16Collections sub-client. - public partial class Int16Collections - { - private readonly Uri _endpoint; - - /// Initializes a new instance of Int16Collections for mocking. - protected Int16Collections() - { - } - - /// Initializes a new instance of Int16Collections. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Service endpoint. - internal Int16Collections(ClientPipeline pipeline, Uri endpoint) - { - _endpoint = endpoint; - Pipeline = pipeline; - } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public ClientPipeline Pipeline { get; } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return SendNested(content, cancellationToken.ToRequestOptions()); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return SendRecord(content, cancellationToken.ToRequestOptions()); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetArray(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableArray(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 1be70298ddc..5a2f9236818 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -41,10 +41,6 @@ public partial class SampleTypeSpecClient private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; private PlantOperations _cachedPlantOperations; - private Int16Collections _cachedInt16Collections; - private UInt16Collections _cachedUInt16Collections; - private UInt32Collections _cachedUInt32Collections; - private UInt64Collections _cachedUInt64Collections; /// Initializes a new instance of SampleTypeSpecClient for mocking. protected SampleTypeSpecClient() @@ -2311,29 +2307,5 @@ public virtual Notebooks GetNotebooksClient(string notebook) return new Notebooks(Pipeline, _endpoint, notebook); } - - /// Initializes a new instance of Int16Collections. - public virtual Int16Collections GetInt16CollectionsClient() - { - return Volatile.Read(ref _cachedInt16Collections) ?? Interlocked.CompareExchange(ref _cachedInt16Collections, new Int16Collections(Pipeline, _endpoint), null) ?? _cachedInt16Collections; - } - - /// Initializes a new instance of UInt16Collections. - public virtual UInt16Collections GetUInt16CollectionsClient() - { - return Volatile.Read(ref _cachedUInt16Collections) ?? Interlocked.CompareExchange(ref _cachedUInt16Collections, new UInt16Collections(Pipeline, _endpoint), null) ?? _cachedUInt16Collections; - } - - /// Initializes a new instance of UInt32Collections. - public virtual UInt32Collections GetUInt32CollectionsClient() - { - return Volatile.Read(ref _cachedUInt32Collections) ?? Interlocked.CompareExchange(ref _cachedUInt32Collections, new UInt32Collections(Pipeline, _endpoint), null) ?? _cachedUInt32Collections; - } - - /// Initializes a new instance of UInt64Collections. - public virtual UInt64Collections GetUInt64CollectionsClient() - { - return Volatile.Read(ref _cachedUInt64Collections) ?? Interlocked.CompareExchange(ref _cachedUInt64Collections, new UInt64Collections(Pipeline, _endpoint), null) ?? _cachedUInt64Collections; - } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs deleted file mode 100644 index 66bd7275486..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.RestClient.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; - -namespace SampleTypeSpec -{ - /// - public partial class UInt16Collections - { - private static PipelineMessageClassifier _pipelineMessageClassifier200; - private static PipelineMessageClassifier _pipelineMessageClassifier204; - - private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); - - private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); - - internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint16-collections/nested-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint16-collections/record-of-arrays", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint16-collections/array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint16-collections/record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint16-collections/nullable-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint16-collections/nullable-record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs deleted file mode 100644 index 30775a12449..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt16Collections.cs +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; - -namespace SampleTypeSpec -{ - /// The UInt16Collections sub-client. - public partial class UInt16Collections - { - private readonly Uri _endpoint; - - /// Initializes a new instance of UInt16Collections for mocking. - protected UInt16Collections() - { - } - - /// Initializes a new instance of UInt16Collections. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Service endpoint. - internal UInt16Collections(ClientPipeline pipeline, Uri endpoint) - { - _endpoint = endpoint; - Pipeline = pipeline; - } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public ClientPipeline Pipeline { get; } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return SendNested(content, cancellationToken.ToRequestOptions()); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return SendRecord(content, cancellationToken.ToRequestOptions()); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetArray(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableArray(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt16()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs deleted file mode 100644 index cc5ddd3f084..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.RestClient.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; - -namespace SampleTypeSpec -{ - /// - public partial class UInt32Collections - { - private static PipelineMessageClassifier _pipelineMessageClassifier200; - private static PipelineMessageClassifier _pipelineMessageClassifier204; - - private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); - - private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); - - internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint32-collections/nested-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint32-collections/record-of-arrays", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint32-collections/array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint32-collections/record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint32-collections/nullable-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint32-collections/nullable-record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs deleted file mode 100644 index 80d8f1b3abb..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt32Collections.cs +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; - -namespace SampleTypeSpec -{ - /// The UInt32Collections sub-client. - public partial class UInt32Collections - { - private readonly Uri _endpoint; - - /// Initializes a new instance of UInt32Collections for mocking. - protected UInt32Collections() - { - } - - /// Initializes a new instance of UInt32Collections. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Service endpoint. - internal UInt32Collections(ClientPipeline pipeline, Uri endpoint) - { - _endpoint = endpoint; - Pipeline = pipeline; - } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public ClientPipeline Pipeline { get; } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return SendNested(content, cancellationToken.ToRequestOptions()); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return SendRecord(content, cancellationToken.ToRequestOptions()); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetArray(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableArray(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt32()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs deleted file mode 100644 index abe73b3860e..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.RestClient.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; - -namespace SampleTypeSpec -{ - /// - public partial class UInt64Collections - { - private static PipelineMessageClassifier _pipelineMessageClassifier200; - private static PipelineMessageClassifier _pipelineMessageClassifier204; - - private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); - - private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); - - internal PipelineMessage CreateSendNestedRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint64-collections/nested-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateSendRecordRequest(BinaryContent content, RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint64-collections/record-of-arrays", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "POST", PipelineMessageClassifier204); - PipelineRequest request = message.Request; - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint64-collections/array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint64-collections/record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableArrayRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint64-collections/nullable-array", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - - internal PipelineMessage CreateGetNullableRecordRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/uint64-collections/nullable-record", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs deleted file mode 100644 index bd1b62930f2..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/UInt64Collections.cs +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; - -namespace SampleTypeSpec -{ - /// The UInt64Collections sub-client. - public partial class UInt64Collections - { - private readonly Uri _endpoint; - - /// Initializes a new instance of UInt64Collections for mocking. - protected UInt64Collections() - { - } - - /// Initializes a new instance of UInt64Collections. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Service endpoint. - internal UInt64Collections(ClientPipeline pipeline, Uri endpoint) - { - _endpoint = endpoint; - Pipeline = pipeline; - } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public ClientPipeline Pipeline { get; } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendNested(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendNested - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendNestedAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendNestedRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendNested(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return SendNested(content, cancellationToken.ToRequestOptions()); - } - - /// SendNested. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendNestedAsync(IEnumerable> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromEnumerable(body); - return await SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult SendRecord(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] SendRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task SendRecordAsync(BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateSendRecordRequest(content, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual ClientResult SendRecord(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return SendRecord(content, cancellationToken.ToRequestOptions()); - } - - /// SendRecord. - /// - /// The cancellation token that can be used to cancel the operation. - /// is null. - /// Service returned a non-success status code. - public virtual async Task SendRecordAsync(IDictionary> body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = BinaryContentHelper.FromDictionary(body); - return await SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetArray(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableArray(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableArray - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableArrayAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableArrayRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableArray(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableArray(cancellationToken.ToRequestOptions()); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// GetNullableArray. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableArrayAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableArrayAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - List value = new List(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndArray) - { - break; - } - value.Add(jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyList)value, result.GetRawResponse()); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetNullableRecord(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] GetNullableRecord - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetNullableRecordAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetNullableRecordRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult> GetNullableRecord(CancellationToken cancellationToken = default) - { - ClientResult result = GetNullableRecord(cancellationToken.ToRequestOptions()); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - - /// GetNullableRecord. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task>> GetNullableRecordAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetNullableRecordAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - IDictionary value = new Dictionary(); - BinaryData data = result.GetRawResponse().Content; - Utf8JsonReader jsonReader = new Utf8JsonReader(data.ToMemory().Span); - jsonReader.Read(); - while (jsonReader.Read()) - { - if (jsonReader.TokenType == JsonTokenType.EndObject) - { - break; - } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.TokenType == JsonTokenType.Null ? null : jsonReader.GetUInt64()); - } - return ClientResult.FromValue((IReadOnlyDictionary)value, result.GetRawResponse()); - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 79013cdbbdc..1867d5cfa83 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -2970,439 +2970,31 @@ "value": "application/json", "decorators": [], "isExactName": false - }, + } + ], + "models": [ { "$id": "294", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType48", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "295", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "296", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType49", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "297", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "298", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType50", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "299", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "300", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType51", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "301", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "302", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType52", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "303", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "304", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType53", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "305", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "306", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType54", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "307", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "308", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType55", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "309", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "310", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType56", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "311", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "312", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType57", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "313", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "314", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType58", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "315", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "316", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType59", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "317", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "318", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType60", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "319", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "320", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType61", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "321", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "322", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType62", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "323", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "324", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType63", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "325", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", + "kind": "model", + "name": "Thing", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.Thing", + "usage": "Input,Output,Spread,Json", + "doc": "A model with a few properties of literal types", "decorators": [], - "isExactName": false - }, - { - "$id": "326", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType64", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "327", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "328", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType65", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "329", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "330", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType66", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "331", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "332", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType67", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "333", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "334", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType68", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "335", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "336", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType69", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "337", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "338", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType70", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "339", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "340", - "kind": "constant", - "name": "GetTreeAsJsonResponseContentType71", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "341", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - } - ], - "models": [ - { - "$id": "342", - "kind": "model", - "name": "Thing", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.Thing", - "usage": "Input,Output,Spread,Json", - "doc": "A model with a few properties of literal types", - "decorators": [], - "serializationOptions": { - "json": { - "name": "Thing" - } + "serializationOptions": { + "json": { + "name": "Thing" + } }, "isExactName": false, "properties": [ { - "$id": "343", + "$id": "295", "kind": "property", "name": "name", "apiVersions": [ @@ -3412,7 +3004,7 @@ "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "344", + "$id": "296", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3433,7 +3025,7 @@ "isExactName": false }, { - "$id": "345", + "$id": "297", "kind": "property", "name": "requiredUnion", "apiVersions": [ @@ -3443,23 +3035,23 @@ "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "346", + "$id": "298", "kind": "union", "name": "ThingRequiredUnion", "variantTypes": [ { - "$id": "347", + "$id": "299", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "348", + "$id": "300", "kind": "array", "name": "Array", "valueType": { - "$id": "349", + "$id": "301", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3469,7 +3061,7 @@ "decorators": [] }, { - "$id": "350", + "$id": "302", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3495,7 +3087,7 @@ "isExactName": false }, { - "$id": "351", + "$id": "303", "kind": "property", "name": "requiredLiteralString", "apiVersions": [ @@ -3522,7 +3114,7 @@ "isExactName": false }, { - "$id": "352", + "$id": "304", "kind": "property", "name": "requiredNullableString", "apiVersions": [ @@ -3532,10 +3124,10 @@ "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$id": "353", + "$id": "305", "kind": "nullable", "type": { - "$id": "354", + "$id": "306", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3558,7 +3150,7 @@ "isExactName": false }, { - "$id": "355", + "$id": "307", "kind": "property", "name": "optionalNullableString", "apiVersions": [ @@ -3568,10 +3160,10 @@ "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$id": "356", + "$id": "308", "kind": "nullable", "type": { - "$id": "357", + "$id": "309", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3594,7 +3186,7 @@ "isExactName": false }, { - "$id": "358", + "$id": "310", "kind": "property", "name": "requiredLiteralInt", "apiVersions": [ @@ -3621,7 +3213,7 @@ "isExactName": false }, { - "$id": "359", + "$id": "311", "kind": "property", "name": "requiredLiteralFloat", "apiVersions": [ @@ -3648,7 +3240,7 @@ "isExactName": false }, { - "$id": "360", + "$id": "312", "kind": "property", "name": "requiredLiteralBool", "apiVersions": [ @@ -3675,7 +3267,7 @@ "isExactName": false }, { - "$id": "361", + "$id": "313", "kind": "property", "name": "optionalLiteralString", "apiVersions": [ @@ -3702,7 +3294,7 @@ "isExactName": false }, { - "$id": "362", + "$id": "314", "kind": "property", "name": "requiredNullableLiteralString", "apiVersions": [ @@ -3712,7 +3304,7 @@ "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$id": "363", + "$id": "315", "kind": "nullable", "type": { "$ref": "5" @@ -3734,7 +3326,7 @@ "isExactName": false }, { - "$id": "364", + "$id": "316", "kind": "property", "name": "optionalLiteralInt", "apiVersions": [ @@ -3761,7 +3353,7 @@ "isExactName": false }, { - "$id": "365", + "$id": "317", "kind": "property", "name": "optionalLiteralFloat", "apiVersions": [ @@ -3788,7 +3380,7 @@ "isExactName": false }, { - "$id": "366", + "$id": "318", "kind": "property", "name": "optionalLiteralBool", "apiVersions": [ @@ -3815,7 +3407,7 @@ "isExactName": false }, { - "$id": "367", + "$id": "319", "kind": "property", "name": "requiredBadDescription", "apiVersions": [ @@ -3825,7 +3417,7 @@ "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "368", + "$id": "320", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3846,7 +3438,7 @@ "isExactName": false }, { - "$id": "369", + "$id": "321", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -3856,14 +3448,14 @@ "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "370", + "$id": "322", "kind": "nullable", "type": { - "$id": "371", + "$id": "323", "kind": "array", "name": "Array1", "valueType": { - "$id": "372", + "$id": "324", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3889,7 +3481,7 @@ "isExactName": false }, { - "$id": "373", + "$id": "325", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -3899,10 +3491,10 @@ "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "374", + "$id": "326", "kind": "nullable", "type": { - "$ref": "371" + "$ref": "323" }, "namespace": "SampleTypeSpec" }, @@ -3921,7 +3513,7 @@ "isExactName": false }, { - "$id": "375", + "$id": "327", "kind": "property", "name": "propertyWithSpecialDocs", "apiVersions": [ @@ -3931,7 +3523,7 @@ "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "376", + "$id": "328", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3954,7 +3546,7 @@ ] }, { - "$id": "377", + "$id": "329", "kind": "model", "name": "RoundTripModel", "apiVersions": [ @@ -3974,7 +3566,7 @@ "isExactName": false, "properties": [ { - "$id": "378", + "$id": "330", "kind": "property", "name": "requiredString", "apiVersions": [ @@ -3984,7 +3576,7 @@ "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "379", + "$id": "331", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4005,7 +3597,7 @@ "isExactName": false }, { - "$id": "380", + "$id": "332", "kind": "property", "name": "requiredInt", "apiVersions": [ @@ -4015,7 +3607,7 @@ "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "381", + "$id": "333", "kind": "int32", "name": "int32", "encode": "string", @@ -4037,7 +3629,7 @@ "isExactName": false }, { - "$id": "382", + "$id": "334", "kind": "property", "name": "requiredCollection", "apiVersions": [ @@ -4047,7 +3639,7 @@ "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "383", + "$id": "335", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -4071,7 +3663,7 @@ "isExactName": false }, { - "$id": "384", + "$id": "336", "kind": "property", "name": "requiredDictionary", "apiVersions": [ @@ -4081,10 +3673,10 @@ "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "385", + "$id": "337", "kind": "dict", "keyType": { - "$id": "386", + "$id": "338", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4110,7 +3702,7 @@ "isExactName": false }, { - "$id": "387", + "$id": "339", "kind": "property", "name": "requiredModel", "apiVersions": [ @@ -4120,7 +3712,7 @@ "serializedName": "requiredModel", "doc": "Required model", "type": { - "$ref": "342" + "$ref": "294" }, "optional": false, "readOnly": false, @@ -4137,7 +3729,7 @@ "isExactName": false }, { - "$id": "388", + "$id": "340", "kind": "property", "name": "intExtensibleEnum", "apiVersions": [ @@ -4164,7 +3756,7 @@ "isExactName": false }, { - "$id": "389", + "$id": "341", "kind": "property", "name": "intExtensibleEnumCollection", "apiVersions": [ @@ -4174,7 +3766,7 @@ "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "390", + "$id": "342", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -4198,7 +3790,7 @@ "isExactName": false }, { - "$id": "391", + "$id": "343", "kind": "property", "name": "floatExtensibleEnum", "apiVersions": [ @@ -4225,7 +3817,7 @@ "isExactName": false }, { - "$id": "392", + "$id": "344", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ @@ -4252,7 +3844,7 @@ "isExactName": false }, { - "$id": "393", + "$id": "345", "kind": "property", "name": "floatExtensibleEnumCollection", "apiVersions": [ @@ -4262,7 +3854,7 @@ "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "394", + "$id": "346", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -4286,7 +3878,7 @@ "isExactName": false }, { - "$id": "395", + "$id": "347", "kind": "property", "name": "floatFixedEnum", "apiVersions": [ @@ -4313,7 +3905,7 @@ "isExactName": false }, { - "$id": "396", + "$id": "348", "kind": "property", "name": "floatFixedEnumWithIntValue", "apiVersions": [ @@ -4340,7 +3932,7 @@ "isExactName": false }, { - "$id": "397", + "$id": "349", "kind": "property", "name": "floatFixedEnumCollection", "apiVersions": [ @@ -4350,7 +3942,7 @@ "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "398", + "$id": "350", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -4374,7 +3966,7 @@ "isExactName": false }, { - "$id": "399", + "$id": "351", "kind": "property", "name": "intFixedEnum", "apiVersions": [ @@ -4401,7 +3993,7 @@ "isExactName": false }, { - "$id": "400", + "$id": "352", "kind": "property", "name": "intFixedEnumCollection", "apiVersions": [ @@ -4411,7 +4003,7 @@ "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "401", + "$id": "353", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -4435,7 +4027,7 @@ "isExactName": false }, { - "$id": "402", + "$id": "354", "kind": "property", "name": "stringFixedEnum", "apiVersions": [ @@ -4462,7 +4054,7 @@ "isExactName": false }, { - "$id": "403", + "$id": "355", "kind": "property", "name": "requiredUnknown", "apiVersions": [ @@ -4472,7 +4064,7 @@ "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "404", + "$id": "356", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4493,7 +4085,7 @@ "isExactName": false }, { - "$id": "405", + "$id": "357", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -4503,7 +4095,7 @@ "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "406", + "$id": "358", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4524,7 +4116,7 @@ "isExactName": false }, { - "$id": "407", + "$id": "359", "kind": "property", "name": "requiredRecordUnknown", "apiVersions": [ @@ -4534,17 +4126,17 @@ "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "408", + "$id": "360", "kind": "dict", "keyType": { - "$id": "409", + "$id": "361", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "410", + "$id": "362", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4567,7 +4159,7 @@ "isExactName": false }, { - "$id": "411", + "$id": "363", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -4577,7 +4169,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "408" + "$ref": "360" }, "optional": true, "readOnly": false, @@ -4594,7 +4186,7 @@ "isExactName": false }, { - "$id": "412", + "$id": "364", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ @@ -4604,7 +4196,7 @@ "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$ref": "408" + "$ref": "360" }, "optional": false, "readOnly": true, @@ -4621,7 +4213,7 @@ "isExactName": false }, { - "$id": "413", + "$id": "365", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ @@ -4631,7 +4223,7 @@ "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$ref": "408" + "$ref": "360" }, "optional": true, "readOnly": true, @@ -4648,7 +4240,7 @@ "isExactName": false }, { - "$id": "414", + "$id": "366", "kind": "property", "name": "modelWithRequiredNullable", "apiVersions": [ @@ -4658,7 +4250,7 @@ "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "415", + "$id": "367", "kind": "model", "name": "ModelWithRequiredNullableProperties", "apiVersions": [ @@ -4678,7 +4270,7 @@ "isExactName": false, "properties": [ { - "$id": "416", + "$id": "368", "kind": "property", "name": "requiredNullablePrimitive", "apiVersions": [ @@ -4688,10 +4280,10 @@ "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "417", + "$id": "369", "kind": "nullable", "type": { - "$id": "418", + "$id": "370", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4714,7 +4306,7 @@ "isExactName": false }, { - "$id": "419", + "$id": "371", "kind": "property", "name": "requiredExtensibleEnum", "apiVersions": [ @@ -4724,7 +4316,7 @@ "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "420", + "$id": "372", "kind": "nullable", "type": { "$ref": "27" @@ -4746,7 +4338,7 @@ "isExactName": false }, { - "$id": "421", + "$id": "373", "kind": "property", "name": "requiredFixedEnum", "apiVersions": [ @@ -4756,7 +4348,7 @@ "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "422", + "$id": "374", "kind": "nullable", "type": { "$ref": "17" @@ -4778,7 +4370,7 @@ "isExactName": false }, { - "$id": "423", + "$id": "375", "kind": "property", "name": "fixedUnion", "apiVersions": [ @@ -4804,7 +4396,7 @@ "isExactName": false }, { - "$id": "424", + "$id": "376", "kind": "property", "name": "numericEnum", "apiVersions": [ @@ -4846,7 +4438,7 @@ "isExactName": false }, { - "$id": "425", + "$id": "377", "kind": "property", "name": "requiredBytes", "apiVersions": [ @@ -4856,7 +4448,7 @@ "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "426", + "$id": "378", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -4880,10 +4472,10 @@ ] }, { - "$ref": "415" + "$ref": "367" }, { - "$id": "427", + "$id": "379", "kind": "model", "name": "Wrapper", "apiVersions": [ @@ -4898,7 +4490,7 @@ "isExactName": false, "properties": [ { - "$id": "428", + "$id": "380", "kind": "property", "name": "p1", "apiVersions": [ @@ -4907,7 +4499,7 @@ ], "doc": "header parameter", "type": { - "$id": "429", + "$id": "381", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4924,7 +4516,7 @@ "isExactName": false }, { - "$id": "430", + "$id": "382", "kind": "property", "name": "action", "apiVersions": [ @@ -4933,7 +4525,7 @@ ], "doc": "body parameter", "type": { - "$ref": "377" + "$ref": "329" }, "optional": false, "readOnly": false, @@ -4946,7 +4538,7 @@ "isExactName": false }, { - "$id": "431", + "$id": "383", "kind": "property", "name": "p2", "apiVersions": [ @@ -4955,7 +4547,7 @@ ], "doc": "path parameter", "type": { - "$id": "432", + "$id": "384", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4974,7 +4566,7 @@ ] }, { - "$id": "433", + "$id": "385", "kind": "model", "name": "Friend", "apiVersions": [ @@ -4994,7 +4586,7 @@ "isExactName": false, "properties": [ { - "$id": "434", + "$id": "386", "kind": "property", "name": "name", "apiVersions": [ @@ -5004,7 +4596,7 @@ "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "435", + "$id": "387", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5027,7 +4619,7 @@ ] }, { - "$id": "436", + "$id": "388", "kind": "model", "name": "RenamedModel", "apiVersions": [ @@ -5047,7 +4639,7 @@ "isExactName": false, "properties": [ { - "$id": "437", + "$id": "389", "kind": "property", "name": "otherName", "apiVersions": [ @@ -5057,7 +4649,7 @@ "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "438", + "$id": "390", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5080,7 +4672,7 @@ ] }, { - "$id": "439", + "$id": "391", "kind": "model", "name": "ReturnsAnonymousModelResponse", "apiVersions": [ @@ -5100,7 +4692,7 @@ "properties": [] }, { - "$id": "440", + "$id": "392", "kind": "model", "name": "ListWithNextLinkResponse", "apiVersions": [ @@ -5119,7 +4711,7 @@ "isExactName": false, "properties": [ { - "$id": "441", + "$id": "393", "kind": "property", "name": "things", "apiVersions": [ @@ -5128,11 +4720,11 @@ ], "serializedName": "things", "type": { - "$id": "442", + "$id": "394", "kind": "array", "name": "ArrayThing", "valueType": { - "$ref": "342" + "$ref": "294" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5152,7 +4744,7 @@ "isExactName": false }, { - "$id": "443", + "$id": "395", "kind": "property", "name": "next", "apiVersions": [ @@ -5161,7 +4753,7 @@ ], "serializedName": "next", "type": { - "$id": "444", + "$id": "396", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -5184,7 +4776,7 @@ ] }, { - "$id": "445", + "$id": "397", "kind": "model", "name": "ListWithStringNextLinkResponse", "apiVersions": [ @@ -5203,7 +4795,7 @@ "isExactName": false, "properties": [ { - "$id": "446", + "$id": "398", "kind": "property", "name": "things", "apiVersions": [ @@ -5212,7 +4804,7 @@ ], "serializedName": "things", "type": { - "$ref": "442" + "$ref": "394" }, "optional": false, "readOnly": false, @@ -5229,7 +4821,7 @@ "isExactName": false }, { - "$id": "447", + "$id": "399", "kind": "property", "name": "next", "apiVersions": [ @@ -5238,7 +4830,7 @@ ], "serializedName": "next", "type": { - "$id": "448", + "$id": "400", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5261,7 +4853,7 @@ ] }, { - "$id": "449", + "$id": "401", "kind": "model", "name": "ListWithContinuationTokenResponse", "apiVersions": [ @@ -5280,7 +4872,7 @@ "isExactName": false, "properties": [ { - "$id": "450", + "$id": "402", "kind": "property", "name": "things", "apiVersions": [ @@ -5289,7 +4881,7 @@ ], "serializedName": "things", "type": { - "$ref": "442" + "$ref": "394" }, "optional": false, "readOnly": false, @@ -5306,7 +4898,7 @@ "isExactName": false }, { - "$id": "451", + "$id": "403", "kind": "property", "name": "nextToken", "apiVersions": [ @@ -5315,7 +4907,7 @@ ], "serializedName": "nextToken", "type": { - "$id": "452", + "$id": "404", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5338,7 +4930,7 @@ ] }, { - "$id": "453", + "$id": "405", "kind": "model", "name": "ListWithContinuationTokenHeaderResponseResponse", "apiVersions": [], @@ -5354,7 +4946,7 @@ "isExactName": false, "properties": [ { - "$id": "454", + "$id": "406", "kind": "property", "name": "things", "apiVersions": [ @@ -5363,7 +4955,7 @@ ], "serializedName": "things", "type": { - "$ref": "442" + "$ref": "394" }, "optional": false, "readOnly": false, @@ -5382,7 +4974,7 @@ ] }, { - "$id": "455", + "$id": "407", "kind": "model", "name": "PageThing", "apiVersions": [ @@ -5401,7 +4993,7 @@ "isExactName": false, "properties": [ { - "$id": "456", + "$id": "408", "kind": "property", "name": "items", "apiVersions": [ @@ -5410,7 +5002,7 @@ ], "serializedName": "items", "type": { - "$ref": "442" + "$ref": "394" }, "optional": false, "readOnly": false, @@ -5429,7 +5021,7 @@ ] }, { - "$id": "457", + "$id": "409", "kind": "model", "name": "ModelWithEmbeddedNonBodyParameters", "apiVersions": [ @@ -5448,7 +5040,7 @@ "isExactName": false, "properties": [ { - "$id": "458", + "$id": "410", "kind": "property", "name": "name", "apiVersions": [ @@ -5458,7 +5050,7 @@ "serializedName": "name", "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "459", + "$id": "411", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5479,7 +5071,7 @@ "isExactName": false }, { - "$id": "460", + "$id": "412", "kind": "property", "name": "requiredHeader", "apiVersions": [ @@ -5489,7 +5081,7 @@ "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$id": "461", + "$id": "413", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5510,7 +5102,7 @@ "isExactName": false }, { - "$id": "462", + "$id": "414", "kind": "property", "name": "optionalHeader", "apiVersions": [ @@ -5520,7 +5112,7 @@ "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$id": "463", + "$id": "415", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5541,7 +5133,7 @@ "isExactName": false }, { - "$id": "464", + "$id": "416", "kind": "property", "name": "requiredQuery", "apiVersions": [ @@ -5551,7 +5143,7 @@ "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "465", + "$id": "417", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5572,7 +5164,7 @@ "isExactName": false }, { - "$id": "466", + "$id": "418", "kind": "property", "name": "optionalQuery", "apiVersions": [ @@ -5582,7 +5174,7 @@ "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "467", + "$id": "419", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5605,7 +5197,7 @@ ] }, { - "$id": "468", + "$id": "420", "kind": "model", "name": "DynamicModel", "apiVersions": [ @@ -5630,7 +5222,7 @@ "isExactName": false, "properties": [ { - "$id": "469", + "$id": "421", "kind": "property", "name": "name", "apiVersions": [ @@ -5639,7 +5231,7 @@ ], "serializedName": "name", "type": { - "$id": "470", + "$id": "422", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5660,7 +5252,7 @@ "isExactName": false }, { - "$id": "471", + "$id": "423", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -5669,7 +5261,7 @@ ], "serializedName": "optionalUnknown", "type": { - "$id": "472", + "$id": "424", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -5690,7 +5282,7 @@ "isExactName": false }, { - "$id": "473", + "$id": "425", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -5699,7 +5291,7 @@ ], "serializedName": "optionalInt", "type": { - "$id": "474", + "$id": "426", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5720,7 +5312,7 @@ "isExactName": false }, { - "$id": "475", + "$id": "427", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -5729,10 +5321,10 @@ ], "serializedName": "optionalNullableList", "type": { - "$id": "476", + "$id": "428", "kind": "nullable", "type": { - "$ref": "371" + "$ref": "323" }, "namespace": "SampleTypeSpec" }, @@ -5751,7 +5343,7 @@ "isExactName": false }, { - "$id": "477", + "$id": "429", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -5760,10 +5352,10 @@ ], "serializedName": "requiredNullableList", "type": { - "$id": "478", + "$id": "430", "kind": "nullable", "type": { - "$ref": "371" + "$ref": "323" }, "namespace": "SampleTypeSpec" }, @@ -5782,7 +5374,7 @@ "isExactName": false }, { - "$id": "479", + "$id": "431", "kind": "property", "name": "optionalNullableDictionary", "apiVersions": [ @@ -5791,20 +5383,20 @@ ], "serializedName": "optionalNullableDictionary", "type": { - "$id": "480", + "$id": "432", "kind": "nullable", "type": { - "$id": "481", + "$id": "433", "kind": "dict", "keyType": { - "$id": "482", + "$id": "434", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "483", + "$id": "435", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5829,7 +5421,7 @@ "isExactName": false }, { - "$id": "484", + "$id": "436", "kind": "property", "name": "requiredNullableDictionary", "apiVersions": [ @@ -5838,10 +5430,10 @@ ], "serializedName": "requiredNullableDictionary", "type": { - "$id": "485", + "$id": "437", "kind": "nullable", "type": { - "$ref": "481" + "$ref": "433" }, "namespace": "SampleTypeSpec" }, @@ -5860,7 +5452,7 @@ "isExactName": false }, { - "$id": "486", + "$id": "438", "kind": "property", "name": "primitiveDictionary", "apiVersions": [ @@ -5869,7 +5461,7 @@ ], "serializedName": "primitiveDictionary", "type": { - "$ref": "481" + "$ref": "433" }, "optional": false, "readOnly": false, @@ -5886,7 +5478,7 @@ "isExactName": false }, { - "$id": "487", + "$id": "439", "kind": "property", "name": "foo", "apiVersions": [ @@ -5895,7 +5487,7 @@ ], "serializedName": "foo", "type": { - "$id": "488", + "$id": "440", "kind": "model", "name": "AnotherDynamicModel", "apiVersions": [ @@ -5920,7 +5512,7 @@ "isExactName": false, "properties": [ { - "$id": "489", + "$id": "441", "kind": "property", "name": "bar", "apiVersions": [ @@ -5929,7 +5521,7 @@ ], "serializedName": "bar", "type": { - "$id": "490", + "$id": "442", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5966,7 +5558,7 @@ "isExactName": false }, { - "$id": "491", + "$id": "443", "kind": "property", "name": "listFoo", "apiVersions": [ @@ -5975,11 +5567,11 @@ ], "serializedName": "listFoo", "type": { - "$id": "492", + "$id": "444", "kind": "array", "name": "ArrayAnotherDynamicModel", "valueType": { - "$ref": "488" + "$ref": "440" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5999,7 +5591,7 @@ "isExactName": false }, { - "$id": "493", + "$id": "445", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -6008,11 +5600,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "494", + "$id": "446", "kind": "array", "name": "ArrayArray", "valueType": { - "$ref": "492" + "$ref": "444" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6032,7 +5624,7 @@ "isExactName": false }, { - "$id": "495", + "$id": "447", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -6041,17 +5633,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "496", + "$id": "448", "kind": "dict", "keyType": { - "$id": "497", + "$id": "449", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "488" + "$ref": "440" }, "decorators": [] }, @@ -6070,7 +5662,7 @@ "isExactName": false }, { - "$id": "498", + "$id": "450", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -6079,17 +5671,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "499", + "$id": "451", "kind": "dict", "keyType": { - "$id": "500", + "$id": "452", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "496" + "$ref": "448" }, "decorators": [] }, @@ -6108,7 +5700,7 @@ "isExactName": false }, { - "$id": "501", + "$id": "453", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -6117,17 +5709,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "502", + "$id": "454", "kind": "dict", "keyType": { - "$id": "503", + "$id": "455", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "492" + "$ref": "444" }, "decorators": [] }, @@ -6146,7 +5738,7 @@ "isExactName": false }, { - "$id": "504", + "$id": "456", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -6155,11 +5747,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "505", + "$id": "457", "kind": "array", "name": "ArrayRecord", "valueType": { - "$ref": "496" + "$ref": "448" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6181,10 +5773,10 @@ ] }, { - "$ref": "488" + "$ref": "440" }, { - "$id": "506", + "$id": "458", "kind": "model", "name": "XmlAdvancedModel", "apiVersions": [ @@ -6213,7 +5805,7 @@ "isExactName": false, "properties": [ { - "$id": "507", + "$id": "459", "kind": "property", "name": "name", "apiVersions": [ @@ -6223,7 +5815,7 @@ "serializedName": "name", "doc": "A simple string property", "type": { - "$id": "508", + "$id": "460", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6246,7 +5838,7 @@ "isExactName": false }, { - "$id": "509", + "$id": "461", "kind": "property", "name": "age", "apiVersions": [ @@ -6256,7 +5848,7 @@ "serializedName": "age", "doc": "An integer property", "type": { - "$id": "510", + "$id": "462", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6279,7 +5871,7 @@ "isExactName": false }, { - "$id": "511", + "$id": "463", "kind": "property", "name": "enabled", "apiVersions": [ @@ -6289,7 +5881,7 @@ "serializedName": "enabled", "doc": "A boolean property", "type": { - "$id": "512", + "$id": "464", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -6312,7 +5904,7 @@ "isExactName": false }, { - "$id": "513", + "$id": "465", "kind": "property", "name": "score", "apiVersions": [ @@ -6322,7 +5914,7 @@ "serializedName": "score", "doc": "A float property", "type": { - "$id": "514", + "$id": "466", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -6345,7 +5937,7 @@ "isExactName": false }, { - "$id": "515", + "$id": "467", "kind": "property", "name": "optionalString", "apiVersions": [ @@ -6355,7 +5947,7 @@ "serializedName": "optionalString", "doc": "An optional string", "type": { - "$id": "516", + "$id": "468", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6378,7 +5970,7 @@ "isExactName": false }, { - "$id": "517", + "$id": "469", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -6388,7 +5980,7 @@ "serializedName": "optionalInt", "doc": "An optional integer", "type": { - "$id": "518", + "$id": "470", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6411,7 +6003,7 @@ "isExactName": false }, { - "$id": "519", + "$id": "471", "kind": "property", "name": "nullableString", "apiVersions": [ @@ -6421,10 +6013,10 @@ "serializedName": "nullableString", "doc": "A nullable string", "type": { - "$id": "520", + "$id": "472", "kind": "nullable", "type": { - "$id": "521", + "$id": "473", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6449,7 +6041,7 @@ "isExactName": false }, { - "$id": "522", + "$id": "474", "kind": "property", "name": "id", "apiVersions": [ @@ -6459,7 +6051,7 @@ "serializedName": "id", "doc": "A string as XML attribute", "type": { - "$id": "523", + "$id": "475", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6487,7 +6079,7 @@ "isExactName": false }, { - "$id": "524", + "$id": "476", "kind": "property", "name": "version", "apiVersions": [ @@ -6497,7 +6089,7 @@ "serializedName": "version", "doc": "An integer as XML attribute", "type": { - "$id": "525", + "$id": "477", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6525,7 +6117,7 @@ "isExactName": false }, { - "$id": "526", + "$id": "478", "kind": "property", "name": "isActive", "apiVersions": [ @@ -6535,7 +6127,7 @@ "serializedName": "isActive", "doc": "A boolean as XML attribute", "type": { - "$id": "527", + "$id": "479", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -6563,7 +6155,7 @@ "isExactName": false }, { - "$id": "528", + "$id": "480", "kind": "property", "name": "originalName", "apiVersions": [ @@ -6573,7 +6165,7 @@ "serializedName": "RenamedProperty", "doc": "A property with a custom XML element name", "type": { - "$id": "529", + "$id": "481", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6603,7 +6195,7 @@ "isExactName": false }, { - "$id": "530", + "$id": "482", "kind": "property", "name": "xmlIdentifier", "apiVersions": [ @@ -6613,7 +6205,7 @@ "serializedName": "xml-id", "doc": "An attribute with a custom XML name", "type": { - "$id": "531", + "$id": "483", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6647,7 +6239,7 @@ "isExactName": false }, { - "$id": "532", + "$id": "484", "kind": "property", "name": "content", "apiVersions": [ @@ -6657,7 +6249,7 @@ "serializedName": "content", "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "533", + "$id": "485", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6685,7 +6277,7 @@ "isExactName": false }, { - "$id": "534", + "$id": "486", "kind": "property", "name": "unwrappedStrings", "apiVersions": [ @@ -6695,7 +6287,7 @@ "serializedName": "unwrappedStrings", "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$ref": "348" + "$ref": "300" }, "optional": false, "readOnly": false, @@ -6720,7 +6312,7 @@ "isExactName": false }, { - "$id": "535", + "$id": "487", "kind": "property", "name": "unwrappedCounts", "apiVersions": [ @@ -6730,7 +6322,7 @@ "serializedName": "unwrappedCounts", "doc": "An unwrapped array of integers", "type": { - "$ref": "371" + "$ref": "323" }, "optional": false, "readOnly": false, @@ -6755,7 +6347,7 @@ "isExactName": false }, { - "$id": "536", + "$id": "488", "kind": "property", "name": "unwrappedItems", "apiVersions": [ @@ -6765,11 +6357,11 @@ "serializedName": "unwrappedItems", "doc": "An unwrapped array of models", "type": { - "$id": "537", + "$id": "489", "kind": "array", "name": "ArrayXmlItem", "valueType": { - "$id": "538", + "$id": "490", "kind": "model", "name": "XmlItem", "apiVersions": [ @@ -6798,7 +6390,7 @@ "isExactName": false, "properties": [ { - "$id": "539", + "$id": "491", "kind": "property", "name": "itemName", "apiVersions": [ @@ -6808,7 +6400,7 @@ "serializedName": "itemName", "doc": "The item name", "type": { - "$id": "540", + "$id": "492", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6831,7 +6423,7 @@ "isExactName": false }, { - "$id": "541", + "$id": "493", "kind": "property", "name": "itemValue", "apiVersions": [ @@ -6841,7 +6433,7 @@ "serializedName": "itemValue", "doc": "The item value", "type": { - "$id": "542", + "$id": "494", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6864,7 +6456,7 @@ "isExactName": false }, { - "$id": "543", + "$id": "495", "kind": "property", "name": "itemId", "apiVersions": [ @@ -6874,7 +6466,7 @@ "serializedName": "itemId", "doc": "Item ID as attribute", "type": { - "$id": "544", + "$id": "496", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6929,7 +6521,7 @@ "isExactName": false }, { - "$id": "545", + "$id": "497", "kind": "property", "name": "wrappedColors", "apiVersions": [ @@ -6939,7 +6531,7 @@ "serializedName": "wrappedColors", "doc": "A wrapped array of strings (default)", "type": { - "$ref": "348" + "$ref": "300" }, "optional": false, "readOnly": false, @@ -6959,7 +6551,7 @@ "isExactName": false }, { - "$id": "546", + "$id": "498", "kind": "property", "name": "items", "apiVersions": [ @@ -6969,7 +6561,7 @@ "serializedName": "ItemCollection", "doc": "A wrapped array with custom wrapper name", "type": { - "$ref": "537" + "$ref": "489" }, "optional": false, "readOnly": false, @@ -6996,7 +6588,7 @@ "isExactName": false }, { - "$id": "547", + "$id": "499", "kind": "property", "name": "nestedModel", "apiVersions": [ @@ -7006,7 +6598,7 @@ "serializedName": "nestedModel", "doc": "A nested model property", "type": { - "$id": "548", + "$id": "500", "kind": "model", "name": "XmlNestedModel", "apiVersions": [ @@ -7028,7 +6620,7 @@ "isExactName": false, "properties": [ { - "$id": "549", + "$id": "501", "kind": "property", "name": "value", "apiVersions": [ @@ -7038,7 +6630,7 @@ "serializedName": "value", "doc": "The value of the nested model", "type": { - "$id": "550", + "$id": "502", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7061,7 +6653,7 @@ "isExactName": false }, { - "$id": "551", + "$id": "503", "kind": "property", "name": "nestedId", "apiVersions": [ @@ -7071,7 +6663,7 @@ "serializedName": "nestedId", "doc": "An attribute on the nested model", "type": { - "$id": "552", + "$id": "504", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7117,7 +6709,7 @@ "isExactName": false }, { - "$id": "553", + "$id": "505", "kind": "property", "name": "optionalNestedModel", "apiVersions": [ @@ -7127,7 +6719,7 @@ "serializedName": "optionalNestedModel", "doc": "An optional nested model", "type": { - "$ref": "548" + "$ref": "500" }, "optional": true, "readOnly": false, @@ -7146,7 +6738,7 @@ "isExactName": false }, { - "$id": "554", + "$id": "506", "kind": "property", "name": "metadata", "apiVersions": [ @@ -7156,17 +6748,17 @@ "serializedName": "metadata", "doc": "A dictionary property", "type": { - "$id": "555", + "$id": "507", "kind": "dict", "keyType": { - "$id": "556", + "$id": "508", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "557", + "$id": "509", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7191,7 +6783,7 @@ "isExactName": false }, { - "$id": "558", + "$id": "510", "kind": "property", "name": "createdAt", "apiVersions": [ @@ -7201,12 +6793,12 @@ "serializedName": "createdAt", "doc": "A date-time property", "type": { - "$id": "559", + "$id": "511", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "560", + "$id": "512", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7232,7 +6824,7 @@ "isExactName": false }, { - "$id": "561", + "$id": "513", "kind": "property", "name": "duration", "apiVersions": [ @@ -7242,12 +6834,12 @@ "serializedName": "duration", "doc": "A duration property", "type": { - "$id": "562", + "$id": "514", "kind": "duration", "name": "duration", "encode": "ISO8601", "wireType": { - "$id": "563", + "$id": "515", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7273,7 +6865,7 @@ "isExactName": false }, { - "$id": "564", + "$id": "516", "kind": "property", "name": "data", "apiVersions": [ @@ -7283,7 +6875,7 @@ "serializedName": "data", "doc": "A bytes property", "type": { - "$id": "565", + "$id": "517", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -7307,7 +6899,7 @@ "isExactName": false }, { - "$id": "566", + "$id": "518", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -7317,7 +6909,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "408" + "$ref": "360" }, "optional": true, "readOnly": false, @@ -7336,7 +6928,7 @@ "isExactName": false }, { - "$id": "567", + "$id": "519", "kind": "property", "name": "fixedEnum", "apiVersions": [ @@ -7365,7 +6957,7 @@ "isExactName": false }, { - "$id": "568", + "$id": "520", "kind": "property", "name": "extensibleEnum", "apiVersions": [ @@ -7394,7 +6986,7 @@ "isExactName": false }, { - "$id": "569", + "$id": "521", "kind": "property", "name": "optionalFixedEnum", "apiVersions": [ @@ -7423,7 +7015,7 @@ "isExactName": false }, { - "$id": "570", + "$id": "522", "kind": "property", "name": "optionalExtensibleEnum", "apiVersions": [ @@ -7452,7 +7044,7 @@ "isExactName": false }, { - "$id": "571", + "$id": "523", "kind": "property", "name": "label", "apiVersions": [ @@ -7461,7 +7053,7 @@ ], "serializedName": "label", "type": { - "$id": "572", + "$id": "524", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7476,14 +7068,14 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "573", + "$id": "525", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$id": "574", + "$id": "526", "kind": "enum", "decorators": [ { @@ -7496,7 +7088,7 @@ "isExactName": false, "namespace": "SampleTypeSpec", "valueType": { - "$id": "575", + "$id": "527", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7505,32 +7097,32 @@ }, "values": [ { - "$id": "576", + "$id": "528", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$ref": "574" + "$ref": "526" }, "valueType": { - "$ref": "575" + "$ref": "527" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" }, { - "$id": "577", + "$id": "529", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "574" + "$ref": "526" }, "valueType": { - "$ref": "575" + "$ref": "527" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -7548,7 +7140,7 @@ "__accessSet": true }, "valueType": { - "$ref": "575" + "$ref": "527" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" } @@ -7575,7 +7167,7 @@ "isExactName": false }, { - "$id": "578", + "$id": "530", "kind": "property", "name": "daysUsed", "apiVersions": [ @@ -7584,7 +7176,7 @@ ], "serializedName": "daysUsed", "type": { - "$id": "579", + "$id": "531", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7599,17 +7191,17 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "580", + "$id": "532", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "574" + "$ref": "526" }, "valueType": { - "$ref": "575" + "$ref": "527" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -7632,7 +7224,7 @@ "isExactName": false }, { - "$id": "581", + "$id": "533", "kind": "property", "name": "fooItems", "apiVersions": [ @@ -7641,7 +7233,7 @@ ], "serializedName": "fooItems", "type": { - "$ref": "348" + "$ref": "300" }, "optional": false, "readOnly": false, @@ -7673,7 +7265,7 @@ "isExactName": false }, { - "$id": "582", + "$id": "534", "kind": "property", "name": "anotherModel", "apiVersions": [ @@ -7682,7 +7274,7 @@ ], "serializedName": "anotherModel", "type": { - "$ref": "548" + "$ref": "500" }, "optional": false, "readOnly": false, @@ -7713,7 +7305,7 @@ "isExactName": false }, { - "$id": "583", + "$id": "535", "kind": "property", "name": "modelsWithNamespaces", "apiVersions": [ @@ -7722,11 +7314,11 @@ ], "serializedName": "modelsWithNamespaces", "type": { - "$id": "584", + "$id": "536", "kind": "array", "name": "ArrayXmlModelWithNamespace", "valueType": { - "$id": "585", + "$id": "537", "kind": "model", "name": "XmlModelWithNamespace", "apiVersions": [ @@ -7759,7 +7351,7 @@ "isExactName": false, "properties": [ { - "$id": "586", + "$id": "538", "kind": "property", "name": "foo", "apiVersions": [ @@ -7768,7 +7360,7 @@ ], "serializedName": "foo", "type": { - "$id": "587", + "$id": "539", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7817,7 +7409,7 @@ "isExactName": false }, { - "$id": "588", + "$id": "540", "kind": "property", "name": "unwrappedModelsWithNamespaces", "apiVersions": [ @@ -7826,7 +7418,7 @@ ], "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$ref": "584" + "$ref": "536" }, "optional": false, "readOnly": false, @@ -7851,7 +7443,7 @@ "isExactName": false }, { - "$id": "589", + "$id": "541", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -7860,11 +7452,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "590", + "$id": "542", "kind": "array", "name": "ArrayArray1", "valueType": { - "$ref": "537" + "$ref": "489" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -7887,7 +7479,7 @@ "isExactName": false }, { - "$id": "591", + "$id": "543", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -7896,17 +7488,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "592", + "$id": "544", "kind": "dict", "keyType": { - "$id": "593", + "$id": "545", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "538" + "$ref": "490" }, "decorators": [] }, @@ -7927,7 +7519,7 @@ "isExactName": false }, { - "$id": "594", + "$id": "546", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -7936,17 +7528,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "595", + "$id": "547", "kind": "dict", "keyType": { - "$id": "596", + "$id": "548", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "592" + "$ref": "544" }, "decorators": [] }, @@ -7967,7 +7559,7 @@ "isExactName": false }, { - "$id": "597", + "$id": "549", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -7976,17 +7568,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "598", + "$id": "550", "kind": "dict", "keyType": { - "$id": "599", + "$id": "551", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "537" + "$ref": "489" }, "decorators": [] }, @@ -8007,7 +7599,7 @@ "isExactName": false }, { - "$id": "600", + "$id": "552", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -8016,11 +7608,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "601", + "$id": "553", "kind": "array", "name": "ArrayRecord1", "valueType": { - "$ref": "592" + "$ref": "544" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -8045,16 +7637,16 @@ ] }, { - "$ref": "538" + "$ref": "490" }, { - "$ref": "548" + "$ref": "500" }, { - "$ref": "585" + "$ref": "537" }, { - "$id": "602", + "$id": "554", "kind": "model", "name": "Cat", "apiVersions": [ @@ -8069,7 +7661,7 @@ "isExactName": false, "properties": [ { - "$id": "603", + "$id": "555", "kind": "property", "name": "id", "apiVersions": [ @@ -8078,7 +7670,7 @@ ], "serializedName": "id", "type": { - "$id": "604", + "$id": "556", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8105,7 +7697,7 @@ "isExactName": false }, { - "$id": "605", + "$id": "557", "kind": "property", "name": "boolPart", "apiVersions": [ @@ -8114,7 +7706,7 @@ ], "serializedName": "boolPart", "type": { - "$id": "606", + "$id": "558", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -8141,7 +7733,7 @@ "isExactName": false }, { - "$id": "607", + "$id": "559", "kind": "property", "name": "int32Part", "apiVersions": [ @@ -8150,7 +7742,7 @@ ], "serializedName": "int32Part", "type": { - "$id": "608", + "$id": "560", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8177,7 +7769,7 @@ "isExactName": false }, { - "$id": "609", + "$id": "561", "kind": "property", "name": "int64Part", "apiVersions": [ @@ -8186,7 +7778,7 @@ ], "serializedName": "int64Part", "type": { - "$id": "610", + "$id": "562", "kind": "int64", "name": "int64", "crossLanguageDefinitionId": "TypeSpec.int64", @@ -8213,7 +7805,7 @@ "isExactName": false }, { - "$id": "611", + "$id": "563", "kind": "property", "name": "float32Part", "apiVersions": [ @@ -8222,7 +7814,7 @@ ], "serializedName": "float32Part", "type": { - "$id": "612", + "$id": "564", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -8249,7 +7841,7 @@ "isExactName": false }, { - "$id": "613", + "$id": "565", "kind": "property", "name": "float64Part", "apiVersions": [ @@ -8258,7 +7850,7 @@ ], "serializedName": "float64Part", "type": { - "$id": "614", + "$id": "566", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -8285,7 +7877,7 @@ "isExactName": false }, { - "$id": "615", + "$id": "567", "kind": "property", "name": "decimalPart", "apiVersions": [ @@ -8294,7 +7886,7 @@ ], "serializedName": "decimalPart", "type": { - "$id": "616", + "$id": "568", "kind": "decimal128", "name": "decimal128", "crossLanguageDefinitionId": "TypeSpec.decimal128", @@ -8321,7 +7913,7 @@ "isExactName": false }, { - "$id": "617", + "$id": "569", "kind": "property", "name": "int8Part", "apiVersions": [ @@ -8330,7 +7922,7 @@ ], "serializedName": "int8Part", "type": { - "$id": "618", + "$id": "570", "kind": "int8", "name": "int8", "crossLanguageDefinitionId": "TypeSpec.int8", @@ -8357,7 +7949,7 @@ "isExactName": false }, { - "$id": "619", + "$id": "571", "kind": "property", "name": "uint8Part", "apiVersions": [ @@ -8366,7 +7958,7 @@ ], "serializedName": "uint8Part", "type": { - "$id": "620", + "$id": "572", "kind": "uint8", "name": "uint8", "crossLanguageDefinitionId": "TypeSpec.uint8", @@ -8393,7 +7985,7 @@ "isExactName": false }, { - "$id": "621", + "$id": "573", "kind": "property", "name": "dictionaryPart", "apiVersions": [ @@ -8402,7 +7994,7 @@ ], "serializedName": "dictionaryPart", "type": { - "$ref": "555" + "$ref": "507" }, "optional": false, "readOnly": false, @@ -8425,7 +8017,7 @@ "isExactName": false }, { - "$id": "622", + "$id": "574", "kind": "property", "name": "dictionaryModelPart", "apiVersions": [ @@ -8434,17 +8026,17 @@ ], "serializedName": "dictionaryModelPart", "type": { - "$id": "623", + "$id": "575", "kind": "dict", "keyType": { - "$id": "624", + "$id": "576", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "342" + "$ref": "294" }, "decorators": [] }, @@ -8469,7 +8061,7 @@ "isExactName": false }, { - "$id": "625", + "$id": "577", "kind": "property", "name": "listPart", "apiVersions": [ @@ -8478,7 +8070,7 @@ ], "serializedName": "listPart", "type": { - "$ref": "348" + "$ref": "300" }, "optional": false, "readOnly": false, @@ -8501,7 +8093,7 @@ "isExactName": false }, { - "$id": "626", + "$id": "578", "kind": "property", "name": "listModelPart", "apiVersions": [ @@ -8510,7 +8102,7 @@ ], "serializedName": "listModelPart", "type": { - "$ref": "442" + "$ref": "394" }, "optional": false, "readOnly": false, @@ -8533,7 +8125,7 @@ "isExactName": false }, { - "$id": "627", + "$id": "579", "kind": "property", "name": "multipleListPart", "apiVersions": [ @@ -8542,11 +8134,11 @@ ], "serializedName": "multipleListPart", "type": { - "$id": "628", + "$id": "580", "kind": "array", "name": "ArrayHttpPart", "valueType": { - "$id": "629", + "$id": "581", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8576,7 +8168,7 @@ "isExactName": false }, { - "$id": "630", + "$id": "582", "kind": "property", "name": "profileImage", "apiVersions": [ @@ -8585,7 +8177,7 @@ ], "serializedName": "profileImage", "type": { - "$id": "631", + "$id": "583", "kind": "model", "name": "File", "apiVersions": [], @@ -8600,14 +8192,14 @@ "isFileType": true, "properties": [ { - "$id": "632", + "$id": "584", "kind": "property", "name": "contentType", "apiVersions": [], "summary": "The allowed media (MIME) types of the file contents.", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "type": { - "$id": "633", + "$id": "585", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8624,14 +8216,14 @@ "isExactName": false }, { - "$id": "634", + "$id": "586", "kind": "property", "name": "filename", "apiVersions": [], "summary": "The name of the file, if any.", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "type": { - "$id": "635", + "$id": "587", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8648,14 +8240,14 @@ "isExactName": false }, { - "$id": "636", + "$id": "588", "kind": "property", "name": "contents", "apiVersions": [], "summary": "The contents of the file.", "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", "type": { - "$id": "637", + "$id": "589", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -8685,12 +8277,12 @@ "isFilePart": true, "isMulti": false, "filename": { - "$id": "638", + "$id": "590", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "summary": "The name of the file, if any.", "apiVersions": [], "type": { - "$id": "639", + "$id": "591", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -8721,12 +8313,12 @@ "serializationOptions": {} }, "contentType": { - "$id": "640", + "$id": "592", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "summary": "The allowed media (MIME) types of the file contents.", "apiVersions": [], "type": { - "$id": "641", + "$id": "593", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -8767,7 +8359,7 @@ "isExactName": false }, { - "$id": "642", + "$id": "594", "kind": "property", "name": "extensibleEnumPart", "apiVersions": [ @@ -8799,7 +8391,7 @@ "isExactName": false }, { - "$id": "643", + "$id": "595", "kind": "property", "name": "fixedEnumPart", "apiVersions": [ @@ -8831,7 +8423,7 @@ "isExactName": false }, { - "$id": "644", + "$id": "596", "kind": "property", "name": "intExtensibleEnumPart", "apiVersions": [ @@ -8863,7 +8455,7 @@ "isExactName": false }, { - "$id": "645", + "$id": "597", "kind": "property", "name": "intFixedEnumPart", "apiVersions": [ @@ -8897,7 +8489,7 @@ ] }, { - "$id": "646", + "$id": "598", "kind": "model", "name": "File", "apiVersions": [], @@ -8912,18 +8504,18 @@ "isFileType": true, "properties": [ { - "$ref": "632" + "$ref": "584" }, { - "$ref": "634" + "$ref": "586" }, { - "$ref": "636" + "$ref": "588" } ] }, { - "$id": "647", + "$id": "599", "kind": "model", "name": "StreamingItem", "apiVersions": [ @@ -8942,7 +8534,7 @@ "isExactName": false, "properties": [ { - "$id": "648", + "$id": "600", "kind": "property", "name": "message", "apiVersions": [ @@ -8951,7 +8543,7 @@ ], "serializedName": "message", "type": { - "$id": "649", + "$id": "601", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8974,7 +8566,7 @@ ] }, { - "$id": "650", + "$id": "602", "kind": "model", "name": "PreviewDetails", "apiVersions": [ @@ -8993,7 +8585,7 @@ "isExactName": false, "properties": [ { - "$id": "651", + "$id": "603", "kind": "property", "name": "choice", "apiVersions": [ @@ -9027,7 +8619,7 @@ } }, { - "$id": "652", + "$id": "604", "kind": "model", "name": "LifecycleModel", "apiVersions": [ @@ -9046,7 +8638,7 @@ "isExactName": false, "properties": [ { - "$id": "653", + "$id": "605", "kind": "property", "name": "preview", "apiVersions": [ @@ -9055,7 +8647,7 @@ ], "serializedName": "preview", "type": { - "$ref": "650" + "$ref": "602" }, "optional": true, "readOnly": false, @@ -9078,7 +8670,7 @@ } }, { - "$id": "654", + "$id": "606", "kind": "property", "name": "choice", "apiVersions": [ @@ -9106,7 +8698,7 @@ ] }, { - "$id": "655", + "$id": "607", "kind": "model", "name": "PagePreviewDetails", "apiVersions": [ @@ -9125,7 +8717,7 @@ "isExactName": false, "properties": [ { - "$id": "656", + "$id": "608", "kind": "property", "name": "items", "apiVersions": [ @@ -9134,11 +8726,11 @@ ], "serializedName": "items", "type": { - "$id": "657", + "$id": "609", "kind": "array", "name": "ArrayPreviewDetails", "valueType": { - "$ref": "650" + "$ref": "602" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -9160,7 +8752,7 @@ ] }, { - "$id": "658", + "$id": "610", "kind": "model", "name": "Animal", "apiVersions": [ @@ -9179,7 +8771,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "659", + "$id": "611", "kind": "property", "name": "kind", "apiVersions": [ @@ -9189,7 +8781,7 @@ "serializedName": "kind", "doc": "The kind of animal", "type": { - "$id": "660", + "$id": "612", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9211,10 +8803,10 @@ }, "properties": [ { - "$ref": "659" + "$ref": "611" }, { - "$id": "661", + "$id": "613", "kind": "property", "name": "name", "apiVersions": [ @@ -9224,7 +8816,7 @@ "serializedName": "name", "doc": "Name of the animal", "type": { - "$id": "662", + "$id": "614", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9247,7 +8839,7 @@ ], "discriminatedSubtypes": { "pet": { - "$id": "663", + "$id": "615", "kind": "model", "name": "Pet", "apiVersions": [ @@ -9267,7 +8859,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "664", + "$id": "616", "kind": "property", "name": "kind", "apiVersions": [ @@ -9293,14 +8885,14 @@ "isExactName": false }, "baseModel": { - "$ref": "658" + "$ref": "610" }, "properties": [ { - "$ref": "664" + "$ref": "616" }, { - "$id": "665", + "$id": "617", "kind": "property", "name": "trained", "apiVersions": [ @@ -9310,7 +8902,7 @@ "serializedName": "trained", "doc": "Whether the pet is trained", "type": { - "$id": "666", + "$id": "618", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -9333,7 +8925,7 @@ ], "discriminatedSubtypes": { "dog": { - "$id": "667", + "$id": "619", "kind": "model", "name": "Dog", "apiVersions": [ @@ -9353,11 +8945,11 @@ }, "isExactName": false, "baseModel": { - "$ref": "663" + "$ref": "615" }, "properties": [ { - "$id": "668", + "$id": "620", "kind": "property", "name": "kind", "apiVersions": [ @@ -9383,7 +8975,7 @@ "isExactName": false }, { - "$id": "669", + "$id": "621", "kind": "property", "name": "breed", "apiVersions": [ @@ -9393,7 +8985,7 @@ "serializedName": "breed", "doc": "The breed of the dog", "type": { - "$id": "670", + "$id": "622", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9418,18 +9010,18 @@ } }, "dog": { - "$ref": "667" + "$ref": "619" } } }, { - "$ref": "663" + "$ref": "615" }, { - "$ref": "667" + "$ref": "619" }, { - "$id": "671", + "$id": "623", "kind": "model", "name": "Tree", "apiVersions": [ @@ -9454,7 +9046,7 @@ }, "isExactName": false, "baseModel": { - "$id": "672", + "$id": "624", "kind": "model", "name": "Plant", "apiVersions": [ @@ -9478,7 +9070,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "673", + "$id": "625", "kind": "property", "name": "species", "apiVersions": [ @@ -9488,7 +9080,7 @@ "serializedName": "species", "doc": "The species of plant", "type": { - "$id": "674", + "$id": "626", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9515,10 +9107,10 @@ }, "properties": [ { - "$ref": "673" + "$ref": "625" }, { - "$id": "675", + "$id": "627", "kind": "property", "name": "id", "apiVersions": [ @@ -9528,7 +9120,7 @@ "serializedName": "id", "doc": "The unique identifier of the plant", "type": { - "$id": "676", + "$id": "628", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9554,7 +9146,7 @@ "isExactName": false }, { - "$id": "677", + "$id": "629", "kind": "property", "name": "height", "apiVersions": [ @@ -9564,7 +9156,7 @@ "serializedName": "height", "doc": "The height of the plant in centimeters", "type": { - "$id": "678", + "$id": "630", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -9592,13 +9184,13 @@ ], "discriminatedSubtypes": { "tree": { - "$ref": "671" + "$ref": "623" } } }, "properties": [ { - "$id": "679", + "$id": "631", "kind": "property", "name": "species", "apiVersions": [ @@ -9629,7 +9221,7 @@ "isExactName": false }, { - "$id": "680", + "$id": "632", "kind": "property", "name": "age", "apiVersions": [ @@ -9639,7 +9231,7 @@ "serializedName": "age", "doc": "The age of the tree in years", "type": { - "$id": "681", + "$id": "633", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -9665,7 +9257,7 @@ "isExactName": false }, { - "$id": "682", + "$id": "634", "kind": "property", "name": "nullableText", "apiVersions": [ @@ -9674,10 +9266,10 @@ ], "serializedName": "nullableText", "type": { - "$id": "683", + "$id": "635", "kind": "nullable", "type": { - "$id": "684", + "$id": "636", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9705,7 +9297,7 @@ "isExactName": false }, { - "$id": "685", + "$id": "637", "kind": "property", "name": "nullableLabels", "apiVersions": [ @@ -9714,10 +9306,10 @@ ], "serializedName": "nullableLabels", "type": { - "$id": "686", + "$id": "638", "kind": "nullable", "type": { - "$ref": "555" + "$ref": "507" }, "namespace": "SampleTypeSpec" }, @@ -9743,10 +9335,10 @@ ] }, { - "$ref": "672" + "$ref": "624" }, { - "$id": "687", + "$id": "639", "kind": "model", "name": "GetWidgetMetricsResponse", "apiVersions": [ @@ -9765,7 +9357,7 @@ "isExactName": false, "properties": [ { - "$id": "688", + "$id": "640", "kind": "property", "name": "numSold", "apiVersions": [ @@ -9774,7 +9366,7 @@ ], "serializedName": "numSold", "type": { - "$id": "689", + "$id": "641", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -9795,7 +9387,7 @@ "isExactName": false }, { - "$id": "690", + "$id": "642", "kind": "property", "name": "averagePrice", "apiVersions": [ @@ -9804,7 +9396,7 @@ ], "serializedName": "averagePrice", "type": { - "$id": "691", + "$id": "643", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -9827,7 +9419,7 @@ ] }, { - "$id": "692", + "$id": "644", "kind": "model", "name": "GetNotebookResponse", "apiVersions": [ @@ -9846,7 +9438,7 @@ "isExactName": false, "properties": [ { - "$id": "693", + "$id": "645", "kind": "property", "name": "name", "apiVersions": [ @@ -9855,7 +9447,7 @@ ], "serializedName": "name", "type": { - "$id": "694", + "$id": "646", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9876,7 +9468,7 @@ "isExactName": false }, { - "$id": "695", + "$id": "647", "kind": "property", "name": "content", "apiVersions": [ @@ -9885,7 +9477,7 @@ ], "serializedName": "content", "type": { - "$id": "696", + "$id": "648", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9908,7 +9500,7 @@ ] }, { - "$id": "697", + "$id": "649", "kind": "model", "name": "NullableDynamicModel", "apiVersions": [ @@ -9930,4626 +9522,1346 @@ "name": "NullableDynamicModel" } }, - "isExactName": false, - "properties": [ - { - "$id": "698", - "kind": "property", - "name": "modelValue", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "modelValue", - "type": { - "$id": "699", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.modelValue", - "serializationOptions": { - "json": { - "name": "modelValue" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "700", - "kind": "property", - "name": "children", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "children", - "type": { - "$id": "701", - "kind": "nullable", - "type": { - "$id": "702", - "kind": "array", - "name": "Array10", - "valueType": { - "$id": "703", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.children", - "serializationOptions": { - "json": { - "name": "children" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "704", - "kind": "property", - "name": "childDictionary", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "childDictionary", - "type": { - "$id": "705", - "kind": "nullable", - "type": { - "$id": "706", - "kind": "dict", - "keyType": { - "$id": "707", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "708", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.childDictionary", - "serializationOptions": { - "json": { - "name": "childDictionary" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "709", - "kind": "property", - "name": "nestedChildren", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nestedChildren", - "type": { - "$id": "710", - "kind": "nullable", - "type": { - "$id": "711", - "kind": "array", - "name": "Array11", - "valueType": { - "$id": "712", - "kind": "nullable", - "type": { - "$id": "713", - "kind": "array", - "name": "Array12", - "valueType": { - "$id": "714", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildren", - "serializationOptions": { - "json": { - "name": "nestedChildren" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "715", - "kind": "property", - "name": "nestedChildDictionary", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nestedChildDictionary", - "type": { - "$id": "716", - "kind": "nullable", - "type": { - "$id": "717", - "kind": "dict", - "keyType": { - "$id": "718", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "719", - "kind": "nullable", - "type": { - "$id": "720", - "kind": "dict", - "keyType": { - "$id": "721", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "722", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildDictionary", - "serializationOptions": { - "json": { - "name": "nestedChildDictionary" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "723", - "kind": "property", - "name": "dictionaryChildren", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "dictionaryChildren", - "type": { - "$id": "724", - "kind": "nullable", - "type": { - "$id": "725", - "kind": "dict", - "keyType": { - "$id": "726", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "727", - "kind": "nullable", - "type": { - "$id": "728", - "kind": "array", - "name": "Array13", - "valueType": { - "$id": "729", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.dictionaryChildren", - "serializationOptions": { - "json": { - "name": "dictionaryChildren" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "730", - "kind": "property", - "name": "listOfDictionaries", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "listOfDictionaries", - "type": { - "$id": "731", - "kind": "nullable", - "type": { - "$id": "732", - "kind": "array", - "name": "Array14", - "valueType": { - "$id": "733", - "kind": "nullable", - "type": { - "$id": "734", - "kind": "dict", - "keyType": { - "$id": "735", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "736", - "kind": "nullable", - "type": { - "$ref": "488" - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.listOfDictionaries", - "serializationOptions": { - "json": { - "name": "listOfDictionaries" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "737", - "kind": "model", - "name": "OptionalNullableDynamicProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableDynamicProperties", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [ - { - "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", - "arguments": {} - } - ], - "serializationOptions": { - "json": { - "name": "OptionalNullableDynamicProperties" - } - }, - "isExactName": false, - "baseModel": { - "$id": "738", - "kind": "model", - "name": "OptionalNullableBase", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableBase" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "739", - "kind": "property", - "name": "inheritedNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "inheritedNullable", - "type": { - "$id": "740", - "kind": "nullable", - "type": { - "$id": "741", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase.inheritedNullable", - "serializationOptions": { - "json": { - "name": "inheritedNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - "properties": [] - }, - { - "$ref": "738" - }, - { - "$id": "742", - "kind": "model", - "name": "OptionalNullableChild", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableChild" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "743", - "kind": "property", - "name": "value", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "value", - "type": { - "$id": "744", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild.value", - "serializationOptions": { - "json": { - "name": "value" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "745", - "kind": "model", - "name": "OptionalNullableProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableProperties" - } - }, - "isExactName": false, - "baseModel": { - "$ref": "738" - }, - "properties": [ - { - "$id": "746", - "kind": "property", - "name": "nullableModel", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableModel", - "type": { - "$id": "747", - "kind": "nullable", - "type": { - "$ref": "742" - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableModel", - "serializationOptions": { - "json": { - "name": "nullableModel" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "748", - "kind": "property", - "name": "nullableString", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableString", - "type": { - "$id": "749", - "kind": "nullable", - "type": { - "$id": "750", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableString", - "serializationOptions": { - "json": { - "name": "nullableString" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "751", - "kind": "property", - "name": "nullableInt", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableInt", - "type": { - "$id": "752", - "kind": "nullable", - "type": { - "$id": "753", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableInt", - "serializationOptions": { - "json": { - "name": "nullableInt" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "754", - "kind": "property", - "name": "nullableBoolean", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableBoolean", - "type": { - "$id": "755", - "kind": "nullable", - "type": { - "$id": "756", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBoolean", - "serializationOptions": { - "json": { - "name": "nullableBoolean" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "757", - "kind": "property", - "name": "nullableEnum", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableEnum", - "type": { - "$id": "758", - "kind": "nullable", - "type": { - "$ref": "17" - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableEnum", - "serializationOptions": { - "json": { - "name": "nullableEnum" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "759", - "kind": "property", - "name": "nullableDateTime", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableDateTime", - "type": { - "$id": "760", - "kind": "nullable", - "type": { - "$id": "761", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "762", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDateTime", - "serializationOptions": { - "json": { - "name": "nullableDateTime" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "763", - "kind": "property", - "name": "nullableBytes", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableBytes", - "type": { - "$id": "764", - "kind": "nullable", - "type": { - "$id": "765", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBytes", - "serializationOptions": { - "json": { - "name": "nullableBytes" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "766", - "kind": "property", - "name": "nullableList", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableList", - "type": { - "$id": "767", - "kind": "nullable", - "type": { - "$id": "768", - "kind": "array", - "name": "Array15", - "valueType": { - "$id": "769", - "kind": "nullable", - "type": { - "$id": "770", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableList", - "serializationOptions": { - "json": { - "name": "nullableList" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "771", - "kind": "property", - "name": "nullableDictionary", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "nullableDictionary", - "type": { - "$id": "772", - "kind": "nullable", - "type": { - "$id": "773", - "kind": "dict", - "keyType": { - "$id": "774", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "775", - "kind": "nullable", - "type": { - "$id": "776", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDictionary", - "serializationOptions": { - "json": { - "name": "nullableDictionary" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "777", - "kind": "property", - "name": "readOnlyNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "readOnlyNullable", - "type": { - "$id": "778", - "kind": "nullable", - "type": { - "$id": "779", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.readOnlyNullable", - "serializationOptions": { - "json": { - "name": "readOnlyNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "780", - "kind": "property", - "name": "requiredNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "requiredNullable", - "type": { - "$id": "781", - "kind": "nullable", - "type": { - "$id": "782", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.requiredNullable", - "serializationOptions": { - "json": { - "name": "requiredNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "783", - "kind": "property", - "name": "optionalNonNullable", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalNonNullable", - "type": { - "$id": "784", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullable", - "serializationOptions": { - "json": { - "name": "optionalNonNullable" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "785", - "kind": "property", - "name": "optionalNonNullableInt", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "optionalNonNullableInt", - "type": { - "$id": "786", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullableInt", - "serializationOptions": { - "json": { - "name": "optionalNonNullableInt" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "787", - "kind": "model", - "name": "OptionalNullableContainer", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableContainer" - } - }, - "isExactName": false, - "properties": [ - { - "$id": "788", - "kind": "property", - "name": "child", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "child", - "type": { - "$ref": "745" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer.child", - "serializationOptions": { - "json": { - "name": "child" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "789", - "kind": "model", - "name": "OptionalNullableFieldNames", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "OptionalNullableFieldNames" - } - }, - "isExactName": false, - "additionalProperties": { - "$id": "790", - "kind": "nullable", - "type": { - "$id": "791", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "properties": [ - { - "$id": "792", - "kind": "property", - "name": "additionalStringProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "additionalStringProperties", - "type": { - "$id": "793", - "kind": "nullable", - "type": { - "$id": "794", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringProperties", - "serializationOptions": { - "json": { - "name": "additionalStringProperties" - } - }, - "isHttpMetadata": false, - "isExactName": false - }, - { - "$id": "795", - "kind": "property", - "name": "additionalStringPropertiesIsDefined", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "serializedName": "additionalStringPropertiesIsDefined", - "type": { - "$id": "796", - "kind": "nullable", - "type": { - "$id": "797", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringPropertiesIsDefined", - "serializationOptions": { - "json": { - "name": "additionalStringPropertiesIsDefined" - } - }, - "isHttpMetadata": false, - "isExactName": false - } - ] - }, - { - "$id": "798", - "kind": "model", - "name": "UnionAdditionalProperties", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "namespace": "SampleTypeSpec", - "crossLanguageDefinitionId": "SampleTypeSpec.UnionAdditionalProperties", - "access": "public", - "usage": "Input,Output,Json", - "decorators": [], - "serializationOptions": { - "json": { - "name": "UnionAdditionalProperties" - } - }, - "isExactName": false, - "additionalProperties": { - "$id": "799", - "kind": "nullable", - "type": { - "$id": "800", - "kind": "union", - "name": "UnionAdditionalPropertiesAdditionalProperty", - "variantTypes": [ - { - "$id": "801", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "802", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - { - "$id": "803", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - ], - "namespace": "SampleTypeSpec", - "decorators": [], - "isExactName": false - }, - "namespace": "SampleTypeSpec" - }, - "properties": [] - }, - { - "$id": "804", - "kind": "model", - "name": "JsonlStreamStreamingItem", - "apiVersions": [], - "namespace": "TypeSpec.Http.Streams", - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream", - "usage": "None", - "doc": "", - "decorators": [], - "serializationOptions": {}, - "isExactName": false, - "properties": [ - { - "$id": "805", - "kind": "property", - "name": "contentType", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "type": { - "$ref": "226" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", - "serializationOptions": {}, - "isHttpMetadata": true, - "isExactName": false - }, - { - "$id": "806", - "kind": "property", - "name": "body", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "type": { - "$id": "807", - "kind": "bytes", - "name": "bytes", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", - "serializationOptions": {}, - "isHttpMetadata": false, - "isExactName": false - } - ] - } - ], - "clients": [ - { - "$id": "808", - "kind": "client", - "name": "SampleTypeSpecClient", - "isExactName": false, - "namespace": "SampleTypeSpec", - "doc": "This is a sample typespec project.", - "methods": [ - { - "$id": "809", - "kind": "basic", - "name": "sayHi", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Return hi", - "operation": { - "$id": "810", - "name": "sayHi", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Return hi", - "accessibility": "public", - "parameters": [ - { - "$id": "811", - "kind": "header", - "name": "headParameter", - "serializedName": "head-parameter", - "type": { - "$id": "812", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", - "methodParameterSegments": [ - { - "$id": "813", - "kind": "method", - "name": "headParameter", - "serializedName": "head-parameter", - "type": { - "$id": "814", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "815", - "kind": "query", - "name": "queryParameter", - "serializedName": "queryParameter", - "type": { - "$id": "816", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "817", - "kind": "method", - "name": "queryParameter", - "serializedName": "queryParameter", - "type": { - "$id": "818", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "819", - "kind": "query", - "name": "optionalQuery", - "serializedName": "optionalQuery", - "type": { - "$id": "820", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "821", - "kind": "method", - "name": "optionalQuery", - "serializedName": "optionalQuery", - "type": { - "$id": "822", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "823", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "116" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", - "methodParameterSegments": [ - { - "$id": "824", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "116" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/hello", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "813" - }, - { - "$ref": "817" - }, - { - "$ref": "821" - }, - { - "$ref": "824" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" - }, - { - "$id": "825", - "kind": "basic", - "name": "helloAgain", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Return hi again", - "operation": { - "$id": "826", - "name": "helloAgain", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Return hi again", - "accessibility": "public", - "parameters": [ - { - "$id": "827", - "kind": "header", - "name": "p1", - "serializedName": "p1", - "type": { - "$id": "828", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", - "methodParameterSegments": [ - { - "$id": "829", - "kind": "method", - "name": "p1", - "serializedName": "p1", - "type": { - "$id": "830", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "831", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "118" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", - "methodParameterSegments": [ - { - "$id": "832", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "118" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "833", - "kind": "path", - "name": "p2", - "serializedName": "p2", - "type": { - "$id": "834", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", - "methodParameterSegments": [ - { - "$id": "835", - "kind": "method", - "name": "p2", - "serializedName": "p2", - "type": { - "$id": "836", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Path", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "837", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "122" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", - "methodParameterSegments": [ - { - "$id": "838", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "122" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "839", - "kind": "body", - "name": "action", - "serializedName": "action", - "type": { - "$ref": "377" - }, - "isApiVersion": false, - "contentTypes": [ - "text/plain" - ], - "defaultContentType": "text/plain", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", - "methodParameterSegments": [ - { - "$id": "840", - "kind": "method", - "name": "action", - "serializedName": "action", - "type": { - "$ref": "377" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": {} - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "377" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/againHi/{p2}", - "requestMediaTypes": [ - "text/plain" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "829" - }, - { - "$ref": "840" - }, - { - "$ref": "832" - }, - { - "$ref": "835" - }, - { - "$ref": "838" - } - ], - "response": { - "type": { - "$ref": "377" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" - }, - { - "$id": "841", - "kind": "basic", - "name": "noContentType", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Return hi again", - "operation": { - "$id": "842", - "name": "noContentType", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Return hi again", - "accessibility": "public", - "parameters": [ - { - "$id": "843", - "kind": "header", - "name": "p1", - "serializedName": "p1", - "type": { - "$id": "844", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", - "methodParameterSegments": [ - { - "$id": "845", - "kind": "method", - "name": "info", - "serializedName": "info", - "type": { - "$ref": "427" - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec..anonymous.info", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "846", - "kind": "method", - "name": "p1", - "serializedName": "p1", - "doc": "header parameter", - "type": { - "$ref": "429" - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p1", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "847", - "kind": "path", - "name": "p2", - "serializedName": "p2", - "type": { - "$id": "848", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", - "methodParameterSegments": [ - { - "$ref": "845" - }, - { - "$id": "849", - "kind": "method", - "name": "p2", - "serializedName": "p2", - "doc": "path parameter", - "type": { - "$ref": "432" - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p2", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "850", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "124" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", - "methodParameterSegments": [ - { - "$id": "851", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "124" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "852", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "126" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", - "methodParameterSegments": [ - { - "$id": "853", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "126" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "854", - "kind": "body", - "name": "action", - "serializedName": "action", - "type": { - "$ref": "377" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", - "methodParameterSegments": [ - { - "$ref": "845" - }, - { - "$id": "855", - "kind": "method", - "name": "action", - "serializedName": "action", - "doc": "body parameter", - "type": { - "$ref": "377" - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.action", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "action" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "377" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/noContentType/{p2}", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "845" - }, - { - "$ref": "851" - }, - { - "$ref": "853" - } - ], - "response": { - "type": { - "$ref": "377" - } - }, - "isOverride": true, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" - }, - { - "$id": "856", - "kind": "basic", - "name": "helloDemo2", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Return hi in demo2", - "operation": { - "$id": "857", - "name": "helloDemo2", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Return hi in demo2", - "accessibility": "public", - "parameters": [ - { - "$id": "858", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "128" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", - "methodParameterSegments": [ - { - "$id": "859", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "128" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/demoHi", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2", - "decorators": [], - "namespace": "SampleTypeSpec", - "experimental": { - "diagnosticId": "SAMPLE0001", - "dependsOn": [] - } - }, - "parameters": [ - { - "$ref": "859" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" - }, - { - "$id": "860", - "kind": "basic", - "name": "createLiteral", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Create with literal value", - "operation": { - "$id": "861", - "name": "createLiteral", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Create with literal value", - "accessibility": "public", - "parameters": [ - { - "$id": "862", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "130" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", - "methodParameterSegments": [ - { - "$id": "863", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "130" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "864", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "132" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", - "methodParameterSegments": [ - { - "$id": "865", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "132" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "866", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "342" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", - "methodParameterSegments": [ - { - "$id": "867", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "342" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/literal", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "867" - }, - { - "$ref": "863" - }, - { - "$ref": "865" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" - }, - { - "$id": "868", - "kind": "basic", - "name": "helloLiteral", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Send literal parameters", - "operation": { - "$id": "869", - "name": "helloLiteral", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Send literal parameters", - "accessibility": "public", - "parameters": [ - { - "$id": "870", - "kind": "header", - "name": "p1", - "serializedName": "p1", - "type": { - "$ref": "134" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", - "methodParameterSegments": [ - { - "$id": "871", - "kind": "method", - "name": "p1", - "serializedName": "p1", - "type": { - "$ref": "136" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "872", - "kind": "path", - "name": "p2", - "serializedName": "p2", - "type": { - "$ref": "138" - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Constant", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", - "methodParameterSegments": [ - { - "$id": "873", - "kind": "method", - "name": "p2", - "serializedName": "p2", - "type": { - "$ref": "140" - }, - "location": "Path", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "874", - "kind": "query", - "name": "p3", - "serializedName": "p3", - "type": { - "$ref": "142" - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Constant", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "875", - "kind": "method", - "name": "p3", - "serializedName": "p3", - "type": { - "$ref": "144" - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "876", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "146" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", - "methodParameterSegments": [ - { - "$id": "877", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "146" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/helloLiteral/{p2}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "871" - }, - { - "$ref": "873" - }, - { - "$ref": "875" - }, - { - "$ref": "877" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" - }, - { - "$id": "878", - "kind": "basic", - "name": "topAction", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "top level method", - "operation": { - "$id": "879", - "name": "topAction", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "top level method", - "accessibility": "public", - "parameters": [ - { - "$id": "880", - "kind": "path", - "name": "action", - "serializedName": "action", - "type": { - "$id": "881", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "882", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", - "methodParameterSegments": [ - { - "$id": "883", - "kind": "method", - "name": "action", - "serializedName": "action", - "type": { - "$id": "884", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "885", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "location": "Path", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "886", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "148" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", - "methodParameterSegments": [ - { - "$id": "887", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "148" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/top/{action}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "883" - }, - { - "$ref": "887" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction" - }, - { - "$id": "888", - "kind": "basic", - "name": "topAction2", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "top level method2", - "operation": { - "$id": "889", - "name": "topAction2", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "top level method2", - "accessibility": "public", - "parameters": [ - { - "$id": "890", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "150" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", - "methodParameterSegments": [ - { - "$id": "891", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "150" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/top2", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": false, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "891" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": false, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" - }, - { - "$id": "892", - "kind": "basic", - "name": "patchAction", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "top level patch", - "operation": { - "$id": "893", - "name": "patchAction", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "top level patch", - "accessibility": "public", - "parameters": [ - { - "$id": "894", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "152" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", - "methodParameterSegments": [ - { - "$id": "895", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "152" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "896", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "154" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", - "methodParameterSegments": [ - { - "$id": "897", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "154" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "898", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "342" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", - "methodParameterSegments": [ - { - "$id": "899", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "342" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "PATCH", - "uri": "{sampleTypeSpecUrl}", - "path": "/patch", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": false, - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "899" - }, - { - "$ref": "895" - }, - { - "$ref": "897" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" - }, - { - "$id": "900", - "kind": "basic", - "name": "anonymousBody", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "body parameter without body decorator", - "operation": { - "$id": "901", - "name": "anonymousBody", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "body parameter without body decorator", - "accessibility": "public", - "parameters": [ - { - "$id": "902", - "kind": "query", - "name": "requiredQueryParam", - "serializedName": "requiredQueryParam", - "type": { - "$ref": "156" - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Constant", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "903", - "kind": "method", - "name": "requiredQueryParam", - "serializedName": "requiredQueryParam", - "type": { - "$ref": "158" - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "904", - "kind": "header", - "name": "requiredHeader", - "serializedName": "required-header", - "type": { - "$ref": "160" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", - "methodParameterSegments": [ - { - "$id": "905", - "kind": "method", - "name": "requiredHeader", - "serializedName": "required-header", - "type": { - "$ref": "162" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "906", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "164" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", - "methodParameterSegments": [ - { - "$id": "907", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "164" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "908", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "166" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", - "methodParameterSegments": [ - { - "$id": "909", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "166" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "910", - "kind": "body", - "name": "thing", - "serializedName": "thing", - "type": { - "$ref": "342" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Spread", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", - "methodParameterSegments": [ - { - "$id": "911", - "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "name of the Thing", - "type": { - "$id": "912", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.name", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/anonymousBody", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody", - "decorators": [], + "isExactName": false, + "properties": [ + { + "$id": "650", + "kind": "property", + "name": "modelValue", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "modelValue", + "type": { + "$id": "651", + "kind": "nullable", + "type": { + "$ref": "440" + }, "namespace": "SampleTypeSpec" }, - "parameters": [ - { - "$ref": "911" - }, - { - "$id": "913", - "kind": "method", - "name": "requiredUnion", - "serializedName": "requiredUnion", - "doc": "required Union", - "type": { - "$ref": "346" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredUnion", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "914", - "kind": "method", - "name": "requiredLiteralString", - "serializedName": "requiredLiteralString", - "doc": "required literal string", - "type": { - "$ref": "100" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "915", - "kind": "method", - "name": "requiredNullableString", - "serializedName": "requiredNullableString", - "doc": "required nullable string", - "type": { - "$ref": "353" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "916", - "kind": "method", - "name": "optionalNullableString", - "serializedName": "optionalNullableString", - "doc": "required optional string", - "type": { - "$ref": "356" - }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "917", - "kind": "method", - "name": "requiredLiteralInt", - "serializedName": "requiredLiteralInt", - "doc": "required literal int", - "type": { - "$ref": "102" + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.modelValue", + "serializationOptions": { + "json": { + "name": "modelValue" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "652", + "kind": "property", + "name": "children", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "children", + "type": { + "$id": "653", + "kind": "nullable", + "type": { + "$id": "654", + "kind": "array", + "name": "Array2", + "valueType": { + "$id": "655", + "kind": "nullable", + "type": { + "$ref": "440" + }, + "namespace": "SampleTypeSpec" }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralInt", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, - { - "$id": "918", - "kind": "method", - "name": "requiredLiteralFloat", - "serializedName": "requiredLiteralFloat", - "doc": "required literal float", - "type": { - "$ref": "104" + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.children", + "serializationOptions": { + "json": { + "name": "children" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "656", + "kind": "property", + "name": "childDictionary", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "childDictionary", + "type": { + "$id": "657", + "kind": "nullable", + "type": { + "$id": "658", + "kind": "dict", + "keyType": { + "$id": "659", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralFloat", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "919", - "kind": "method", - "name": "requiredLiteralBool", - "serializedName": "requiredLiteralBool", - "doc": "required literal bool", - "type": { - "$ref": "106" + "valueType": { + "$id": "660", + "kind": "nullable", + "type": { + "$ref": "440" + }, + "namespace": "SampleTypeSpec" }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralBool", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "decorators": [] }, - { - "$id": "920", - "kind": "method", - "name": "optionalLiteralString", - "serializedName": "optionalLiteralString", - "doc": "optional literal string", - "type": { - "$id": "921", - "kind": "enum", - "name": "ThingOptionalLiteralString", - "apiVersions": [], - "crossLanguageDefinitionId": "", - "valueType": { - "$id": "922", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.childDictionary", + "serializationOptions": { + "json": { + "name": "childDictionary" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "661", + "kind": "property", + "name": "nestedChildren", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nestedChildren", + "type": { + "$id": "662", + "kind": "nullable", + "type": { + "$id": "663", + "kind": "array", + "name": "Array3", + "valueType": { + "$id": "664", + "kind": "nullable", + "type": { + "$id": "665", + "kind": "array", + "name": "Array4", + "valueType": { + "$id": "666", + "kind": "nullable", + "type": { + "$ref": "440" + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] }, - "values": [ - { - "$id": "923", - "kind": "enumvalue", - "name": "reject", - "value": "reject", - "valueType": { - "$id": "924", - "kind": "string", - "decorators": [], - "doc": "A sequence of textual characters.", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "enumType": { - "$ref": "921" - }, - "decorators": [], - "isExactName": false - } - ], - "namespace": "SampleTypeSpec", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, - { - "$id": "925", - "kind": "method", - "name": "requiredNullableLiteralString", - "serializedName": "requiredNullableLiteralString", - "doc": "required nullable literal string", - "type": { - "$ref": "363" + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildren", + "serializationOptions": { + "json": { + "name": "nestedChildren" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "667", + "kind": "property", + "name": "nestedChildDictionary", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nestedChildDictionary", + "type": { + "$id": "668", + "kind": "nullable", + "type": { + "$id": "669", + "kind": "dict", + "keyType": { + "$id": "670", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableLiteralString", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "926", - "kind": "method", - "name": "optionalLiteralInt", - "serializedName": "optionalLiteralInt", - "doc": "optional literal int", - "type": { - "$id": "927", - "kind": "enum", - "name": "ThingOptionalLiteralInt", - "apiVersions": [], - "crossLanguageDefinitionId": "", - "valueType": { - "$id": "928", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", + "valueType": { + "$id": "671", + "kind": "nullable", + "type": { + "$id": "672", + "kind": "dict", + "keyType": { + "$id": "673", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "674", + "kind": "nullable", + "type": { + "$ref": "440" + }, + "namespace": "SampleTypeSpec" + }, "decorators": [] }, - "values": [ - { - "$id": "929", - "kind": "enumvalue", - "name": "456", - "value": 456, - "valueType": { - "$id": "930", - "kind": "int32", - "decorators": [], - "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32" - }, - "enumType": { - "$ref": "927" + "namespace": "SampleTypeSpec" + }, + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.nestedChildDictionary", + "serializationOptions": { + "json": { + "name": "nestedChildDictionary" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "675", + "kind": "property", + "name": "dictionaryChildren", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "dictionaryChildren", + "type": { + "$id": "676", + "kind": "nullable", + "type": { + "$id": "677", + "kind": "dict", + "keyType": { + "$id": "678", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "679", + "kind": "nullable", + "type": { + "$id": "680", + "kind": "array", + "name": "Array5", + "valueType": { + "$id": "681", + "kind": "nullable", + "type": { + "$ref": "440" }, - "decorators": [], - "isExactName": false - } - ], - "namespace": "SampleTypeSpec", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralInt", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "decorators": [] }, - { - "$id": "931", - "kind": "method", - "name": "optionalLiteralFloat", - "serializedName": "optionalLiteralFloat", - "doc": "optional literal float", - "type": { - "$id": "932", - "kind": "enum", - "name": "ThingOptionalLiteralFloat", - "apiVersions": [], - "crossLanguageDefinitionId": "", - "valueType": { - "$id": "933", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.dictionaryChildren", + "serializationOptions": { + "json": { + "name": "dictionaryChildren" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "682", + "kind": "property", + "name": "listOfDictionaries", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "listOfDictionaries", + "type": { + "$id": "683", + "kind": "nullable", + "type": { + "$id": "684", + "kind": "array", + "name": "Array6", + "valueType": { + "$id": "685", + "kind": "nullable", + "type": { + "$id": "686", + "kind": "dict", + "keyType": { + "$id": "687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "688", + "kind": "nullable", + "type": { + "$ref": "440" + }, + "namespace": "SampleTypeSpec" + }, "decorators": [] }, - "values": [ - { - "$id": "934", - "kind": "enumvalue", - "name": "4.56", - "value": 4.56, - "valueType": { - "$id": "935", - "kind": "float32", - "decorators": [], - "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32" - }, - "enumType": { - "$ref": "932" - }, - "decorators": [], - "isExactName": false - } - ], - "namespace": "SampleTypeSpec", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralFloat", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] }, - { - "$id": "936", - "kind": "method", - "name": "optionalLiteralBool", - "serializedName": "optionalLiteralBool", - "doc": "optional literal bool", + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.NullableDynamicModel.listOfDictionaries", + "serializationOptions": { + "json": { + "name": "listOfDictionaries" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "689", + "kind": "model", + "name": "OptionalNullableDynamicProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableDynamicProperties", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [ + { + "name": "TypeSpec.HttpClient.CSharp.@dynamicModel", + "arguments": {} + } + ], + "serializationOptions": { + "json": { + "name": "OptionalNullableDynamicProperties" + } + }, + "isExactName": false, + "baseModel": { + "$id": "690", + "kind": "model", + "name": "OptionalNullableBase", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableBase" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "691", + "kind": "property", + "name": "inheritedNullable", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "inheritedNullable", + "type": { + "$id": "692", + "kind": "nullable", "type": { - "$ref": "108" + "$id": "693", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralBool", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableBase.inheritedNullable", + "serializationOptions": { + "json": { + "name": "inheritedNullable" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + "properties": [] + }, + { + "$ref": "690" + }, + { + "$id": "694", + "kind": "model", + "name": "OptionalNullableChild", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableChild" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "695", + "kind": "property", + "name": "value", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "value", + "type": { + "$id": "696", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableChild.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "697", + "kind": "model", + "name": "OptionalNullableProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableProperties" + } + }, + "isExactName": false, + "baseModel": { + "$ref": "690" + }, + "properties": [ + { + "$id": "698", + "kind": "property", + "name": "nullableModel", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableModel", + "type": { + "$id": "699", + "kind": "nullable", + "type": { + "$ref": "694" + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableModel", + "serializationOptions": { + "json": { + "name": "nullableModel" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "700", + "kind": "property", + "name": "nullableString", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableString", + "type": { + "$id": "701", + "kind": "nullable", + "type": { + "$id": "702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - { - "$id": "937", - "kind": "method", - "name": "requiredBadDescription", - "serializedName": "requiredBadDescription", - "doc": "description with xml <|endoftext|>", - "type": { - "$id": "938", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredBadDescription", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableString", + "serializationOptions": { + "json": { + "name": "nullableString" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "703", + "kind": "property", + "name": "nullableInt", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableInt", + "type": { + "$id": "704", + "kind": "nullable", + "type": { + "$id": "705", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] }, - { - "$id": "939", - "kind": "method", - "name": "optionalNullableList", - "serializedName": "optionalNullableList", - "doc": "optional nullable collection", - "type": { - "$ref": "370" - }, - "location": "Body", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableList", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableInt", + "serializationOptions": { + "json": { + "name": "nullableInt" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "706", + "kind": "property", + "name": "nullableBoolean", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableBoolean", + "type": { + "$id": "707", + "kind": "nullable", + "type": { + "$id": "708", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] }, - { - "$id": "940", - "kind": "method", - "name": "requiredNullableList", - "serializedName": "requiredNullableList", - "doc": "required nullable collection", - "type": { - "$ref": "374" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableList", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBoolean", + "serializationOptions": { + "json": { + "name": "nullableBoolean" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "709", + "kind": "property", + "name": "nullableEnum", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableEnum", + "type": { + "$id": "710", + "kind": "nullable", + "type": { + "$ref": "17" }, - { - "$id": "941", - "kind": "method", - "name": "propertyWithSpecialDocs", - "serializedName": "propertyWithSpecialDocs", - "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", - "type": { - "$id": "942", + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableEnum", + "serializationOptions": { + "json": { + "name": "nullableEnum" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "711", + "kind": "property", + "name": "nullableDateTime", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableDateTime", + "type": { + "$id": "712", + "kind": "nullable", + "type": { + "$id": "713", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "714", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.propertyWithSpecialDocs", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$ref": "903" - }, - { - "$ref": "905" + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] }, - { - "$ref": "907" + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDateTime", + "serializationOptions": { + "json": { + "name": "nullableDateTime" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "715", + "kind": "property", + "name": "nullableBytes", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "nullableBytes", + "type": { + "$id": "716", + "kind": "nullable", + "type": { + "$id": "717", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] }, - { - "$ref": "909" + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableBytes", + "serializationOptions": { + "json": { + "name": "nullableBytes" } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "718", + "kind": "property", + "name": "nullableList", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" ], - "response": { + "serializedName": "nullableList", + "type": { + "$id": "719", + "kind": "nullable", "type": { - "$ref": "342" + "$id": "720", + "kind": "array", + "name": "Array7", + "valueType": { + "$id": "721", + "kind": "nullable", + "type": { + "$id": "722", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableList", + "serializationOptions": { + "json": { + "name": "nullableList" } }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" + "isHttpMetadata": false, + "isExactName": false }, { - "$id": "943", - "kind": "basic", - "name": "friendlyModel", - "isExactName": false, - "accessibility": "public", + "$id": "723", + "kind": "property", + "name": "nullableDictionary", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Model can have its friendly name", - "operation": { - "$id": "944", - "name": "friendlyModel", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Model can have its friendly name", - "accessibility": "public", - "parameters": [ - { - "$id": "945", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "178" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", - "methodParameterSegments": [ - { - "$id": "946", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "178" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false + "serializedName": "nullableDictionary", + "type": { + "$id": "724", + "kind": "nullable", + "type": { + "$id": "725", + "kind": "dict", + "keyType": { + "$id": "726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - { - "$id": "947", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "valueType": { + "$id": "727", + "kind": "nullable", "type": { - "$ref": "180" + "$id": "728", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", - "methodParameterSegments": [ - { - "$id": "948", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "180" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false + "namespace": "SampleTypeSpec" }, - { - "$id": "949", - "kind": "body", - "name": "friend", - "serializedName": "friend", - "type": { - "$ref": "433" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Spread", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", - "methodParameterSegments": [ - { - "$id": "950", - "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "name of the NotFriend", - "type": { - "$id": "951", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.name", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "433" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/friendlyName", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel", - "decorators": [], + "decorators": [] + }, "namespace": "SampleTypeSpec" }, - "parameters": [ - { - "$ref": "950" - }, - { - "$ref": "946" + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.nullableDictionary", + "serializationOptions": { + "json": { + "name": "nullableDictionary" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "729", + "kind": "property", + "name": "readOnlyNullable", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "readOnlyNullable", + "type": { + "$id": "730", + "kind": "nullable", + "type": { + "$id": "731", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - { - "$ref": "948" + "namespace": "SampleTypeSpec" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.readOnlyNullable", + "serializationOptions": { + "json": { + "name": "readOnlyNullable" } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "732", + "kind": "property", + "name": "requiredNullable", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" ], - "response": { + "serializedName": "requiredNullable", + "type": { + "$id": "733", + "kind": "nullable", "type": { - "$ref": "433" + "$id": "734", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.requiredNullable", + "serializationOptions": { + "json": { + "name": "requiredNullable" } }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" + "isHttpMetadata": false, + "isExactName": false }, { - "$id": "952", - "kind": "basic", - "name": "addTimeHeader", - "isExactName": false, - "accessibility": "public", + "$id": "735", + "kind": "property", + "name": "optionalNonNullable", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "operation": { - "$id": "953", - "name": "addTimeHeader", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "954", - "kind": "header", - "name": "repeatabilityFirstSent", - "serializedName": "Repeatability-First-Sent", - "type": { - "$id": "955", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc7231", - "wireType": { - "$id": "956", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "isApiVersion": false, - "optional": true, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", - "methodParameterSegments": [ - { - "$id": "957", - "kind": "method", - "name": "repeatabilityFirstSent", - "serializedName": "Repeatability-First-Sent", - "type": { - "$id": "958", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc7231", - "wireType": { - "$id": "959", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "location": "Header", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader", - "decorators": [], + "serializedName": "optionalNonNullable", + "type": { + "$id": "736", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullable", + "serializationOptions": { + "json": { + "name": "optionalNonNullable" + } + }, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "737", + "kind": "property", + "name": "optionalNonNullableInt", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "optionalNonNullableInt", + "type": { + "$id": "738", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableProperties.optionalNonNullableInt", + "serializationOptions": { + "json": { + "name": "optionalNonNullableInt" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "739", + "kind": "model", + "name": "OptionalNullableContainer", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableContainer" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "740", + "kind": "property", + "name": "child", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "child", + "type": { + "$ref": "697" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableContainer.child", + "serializationOptions": { + "json": { + "name": "child" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "741", + "kind": "model", + "name": "OptionalNullableFieldNames", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "OptionalNullableFieldNames" + } + }, + "isExactName": false, + "additionalProperties": { + "$id": "742", + "kind": "nullable", + "type": { + "$id": "743", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "namespace": "SampleTypeSpec" + }, + "properties": [ + { + "$id": "744", + "kind": "property", + "name": "additionalStringProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "serializedName": "additionalStringProperties", + "type": { + "$id": "745", + "kind": "nullable", + "type": { + "$id": "746", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, "namespace": "SampleTypeSpec" }, - "parameters": [ - { - "$ref": "957" + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringProperties", + "serializationOptions": { + "json": { + "name": "additionalStringProperties" } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" + }, + "isHttpMetadata": false, + "isExactName": false }, { - "$id": "960", - "kind": "basic", - "name": "projectedNameModel", - "isExactName": false, - "accessibility": "public", + "$id": "747", + "kind": "property", + "name": "additionalStringPropertiesIsDefined", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Model can have its projected name", - "operation": { - "$id": "961", - "name": "projectedNameModel", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "Model can have its projected name", - "accessibility": "public", - "parameters": [ - { - "$id": "962", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "182" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", - "methodParameterSegments": [ - { - "$id": "963", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "182" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "964", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "184" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", - "methodParameterSegments": [ - { - "$id": "965", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "184" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "966", - "kind": "body", - "name": "renamedModel", - "serializedName": "renamedModel", - "type": { - "$ref": "436" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Spread", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", - "methodParameterSegments": [ - { - "$id": "967", - "kind": "method", - "name": "otherName", - "serializedName": "otherName", - "doc": "name of the ModelWithClientName", - "type": { - "$id": "968", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.otherName", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "436" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/projectedName", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel", - "decorators": [], + "serializedName": "additionalStringPropertiesIsDefined", + "type": { + "$id": "748", + "kind": "nullable", + "type": { + "$id": "749", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, "namespace": "SampleTypeSpec" }, - "parameters": [ + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.OptionalNullableFieldNames.additionalStringPropertiesIsDefined", + "serializationOptions": { + "json": { + "name": "additionalStringPropertiesIsDefined" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + }, + { + "$id": "750", + "kind": "model", + "name": "UnionAdditionalProperties", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.UnionAdditionalProperties", + "access": "public", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionAdditionalProperties" + } + }, + "isExactName": false, + "additionalProperties": { + "$id": "751", + "kind": "nullable", + "type": { + "$id": "752", + "kind": "union", + "name": "UnionAdditionalPropertiesAdditionalProperty", + "variantTypes": [ { - "$ref": "967" + "$id": "753", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, { - "$ref": "963" + "$id": "754", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] }, { - "$ref": "965" + "$id": "755", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] } ], - "response": { - "type": { - "$ref": "436" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" + "namespace": "SampleTypeSpec", + "decorators": [], + "isExactName": false }, + "namespace": "SampleTypeSpec" + }, + "properties": [] + }, + { + "$id": "756", + "kind": "model", + "name": "JsonlStreamStreamingItem", + "apiVersions": [], + "namespace": "TypeSpec.Http.Streams", + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream", + "usage": "None", + "doc": "", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, + "properties": [ { - "$id": "969", - "kind": "basic", - "name": "returnsAnonymousModel", - "isExactName": false, - "accessibility": "public", + "$id": "757", + "kind": "property", + "name": "contentType", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "return anonymous model", - "operation": { - "$id": "970", - "name": "returnsAnonymousModel", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "return anonymous model", - "accessibility": "public", - "parameters": [ - { - "$id": "971", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "186" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", - "methodParameterSegments": [ - { - "$id": "972", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "186" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "439" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/returnsAnonymousModel", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "972" - } - ], - "response": { - "type": { - "$ref": "439" - } + "type": { + "$ref": "226" }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", + "serializationOptions": {}, + "isHttpMetadata": true, + "isExactName": false }, { - "$id": "973", - "kind": "basic", - "name": "getUnknownValue", - "isExactName": false, - "accessibility": "public", + "$id": "758", + "kind": "property", + "name": "body", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "get extensible enum", - "operation": { - "$id": "974", - "name": "getUnknownValue", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "get extensible enum", - "accessibility": "public", - "parameters": [ - { - "$id": "975", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "188" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", - "methodParameterSegments": [ - { - "$id": "976", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "188" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "87" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "text/plain" - ], - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/unknown-value", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "976" - } - ], - "response": { - "type": { - "$ref": "87" - } + "type": { + "$id": "759", + "kind": "bytes", + "name": "bytes", + "crossLanguageDefinitionId": "", + "decorators": [] }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" - }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + } + ] + } + ], + "clients": [ + { + "$id": "760", + "kind": "client", + "name": "SampleTypeSpecClient", + "isExactName": false, + "namespace": "SampleTypeSpec", + "doc": "This is a sample typespec project.", + "methods": [ { - "$id": "977", + "$id": "761", "kind": "basic", - "name": "internalProtocol", + "name": "sayHi", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "When set protocol false and convenient true, then the protocol method should be internal", + "doc": "Return hi", "operation": { - "$id": "978", - "name": "internalProtocol", + "$id": "762", + "name": "sayHi", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "When set protocol false and convenient true, then the protocol method should be internal", + "doc": "Return hi", "accessibility": "public", "parameters": [ { - "$id": "979", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "190" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", - "methodParameterSegments": [ - { - "$id": "980", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "190" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "981", + "$id": "763", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "headParameter", + "serializedName": "head-parameter", "type": { - "$ref": "192" + "$id": "764", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, "optional": false, "isContentType": false, - "scope": "Constant", + "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "methodParameterSegments": [ { - "$id": "982", + "$id": "765", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "headParameter", + "serializedName": "head-parameter", "type": { - "$ref": "192" + "$id": "766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "readOnly": false, "access": "public", "decorators": [], @@ -14559,177 +10871,57 @@ "isExactName": false }, { - "$id": "983", - "kind": "body", - "name": "body", - "serializedName": "body", + "$id": "767", + "kind": "query", + "name": "queryParameter", + "serializedName": "queryParameter", "type": { - "$ref": "342" + "$id": "768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", + "explode": false, "optional": false, "scope": "Method", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "984", + "$id": "769", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "queryParameter", + "serializedName": "queryParameter", "type": { - "$ref": "342" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "342" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/internalProtocol", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": false, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "984" - }, - { - "$ref": "980" - }, - { - "$ref": "982" - } - ], - "response": { - "type": { - "$ref": "342" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": false, - "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" - }, - { - "$id": "985", - "kind": "basic", - "name": "stillConvenient", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", - "operation": { - "$id": "986", - "name": "stillConvenient", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", - "accessibility": "public", - "parameters": [], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/stillConvenient", - "bufferResponse": true, - "generateProtocolMethod": false, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": false, - "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" - }, - { - "$id": "987", - "kind": "basic", - "name": "headAsBoolean", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "head as boolean.", - "operation": { - "$id": "988", - "name": "headAsBoolean", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "head as boolean.", - "accessibility": "public", - "parameters": [ + "$id": "770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.queryParameter", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "989", - "kind": "path", - "name": "id", - "serializedName": "id", + "$id": "771", + "kind": "query", + "name": "optionalQuery", + "serializedName": "optionalQuery", "type": { - "$id": "990", + "$id": "772", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -14737,32 +10929,66 @@ }, "isApiVersion": false, "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, + "optional": true, "scope": "Method", "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "991", + "$id": "773", "kind": "method", - "name": "id", - "serializedName": "id", + "name": "optionalQuery", + "serializedName": "optionalQuery", "type": { - "$id": "992", + "$id": "774", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "location": "Path", + "location": "Query", "isApiVersion": false, - "optional": false, + "optional": true, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.optionalQuery", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "775", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "116" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", + "methodParameterSegments": [ + { + "$id": "776", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "116" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", "readOnly": false, "access": "public", "decorators": [], @@ -14775,38 +11001,61 @@ "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "294" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "HEAD", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/headAsBoolean/{id}", + "path": "/hello", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean", + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "991" + "$ref": "765" + }, + { + "$ref": "769" + }, + { + "$ref": "773" + }, + { + "$ref": "776" } ], - "response": {}, + "response": { + "type": { + "$ref": "294" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" + "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "993", + "$id": "777", "kind": "basic", - "name": "WithApiVersion", + "name": "helloAgain", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -14815,20 +11064,20 @@ ], "doc": "Return hi again", "operation": { - "$id": "994", - "name": "WithApiVersion", + "$id": "778", + "name": "helloAgain", "isExactName": false, "resourceName": "SampleTypeSpec", "doc": "Return hi again", "accessibility": "public", "parameters": [ { - "$id": "995", + "$id": "779", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "996", + "$id": "780", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -14840,15 +11089,15 @@ "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "methodParameterSegments": [ { - "$id": "997", + "$id": "781", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "998", + "$id": "782", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -14858,7 +11107,7 @@ "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "readOnly": false, "access": "public", "decorators": [], @@ -14868,126 +11117,97 @@ "isExactName": false }, { - "$id": "999", - "kind": "query", - "name": "apiVersion", - "serializedName": "apiVersion", + "$id": "783", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", "type": { - "$id": "1000", + "$ref": "118" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", + "methodParameterSegments": [ + { + "$id": "784", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "118" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "785", + "kind": "path", + "name": "p2", + "serializedName": "p2", + "type": { + "$id": "786", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "isApiVersion": true, + "isApiVersion": false, "explode": false, - "defaultValue": { - "type": { - "$id": "1001", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "2024-08-16-preview" - }, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "scope": "Client", + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", "methodParameterSegments": [ { - "$id": "1002", + "$id": "787", "kind": "method", - "name": "apiVersion", - "serializedName": "apiVersion", + "name": "p2", + "serializedName": "p2", "type": { - "$id": "1003", + "$id": "788", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "location": "", - "isApiVersion": true, - "defaultValue": { - "type": { - "$id": "1004", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "2024-08-16-preview" - }, - "optional": true, + "location": "Path", + "isApiVersion": false, + "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/WithApiVersion", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "997" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" - }, - { - "$id": "1005", - "kind": "paging", - "name": "ListWithNextLink", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "List things with nextlink", - "operation": { - "$id": "1006", - "name": "ListWithNextLink", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with nextlink", - "accessibility": "public", - "parameters": [ + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, { - "$id": "1007", + "$id": "789", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "194" + "$ref": "122" }, "isApiVersion": false, "optional": false, @@ -14995,21 +11215,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "methodParameterSegments": [ { - "$id": "1008", + "$id": "790", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "194" + "$ref": "122" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "readOnly": false, "access": "public", "decorators": [], @@ -15017,6 +11237,47 @@ } ], "isExactName": false + }, + { + "$id": "791", + "kind": "body", + "name": "action", + "serializedName": "action", + "type": { + "$ref": "329" + }, + "isApiVersion": false, + "contentTypes": [ + "text/plain" + ], + "defaultContentType": "text/plain", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", + "methodParameterSegments": [ + { + "$id": "792", + "kind": "method", + "name": "action", + "serializedName": "action", + "type": { + "$ref": "329" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": {} } ], "responses": [ @@ -15025,7 +11286,7 @@ 200 ], "bodyType": { - "$ref": "440" + "$ref": "329" }, "headers": [], "isErrorResponse": false, @@ -15041,93 +11302,115 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/link", + "path": "/againHi/{p2}", + "requestMediaTypes": [ + "text/plain" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1008" + "$ref": "781" + }, + { + "$ref": "792" + }, + { + "$ref": "784" + }, + { + "$ref": "787" + }, + { + "$ref": "790" } ], "response": { "type": { - "$ref": "442" - }, - "resultSegments": [ - "things" - ] + "$ref": "329" + } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "nextLink": { - "verb": "GET", - "responseSegments": [ - "next" - ], - "responseLocation": "Body" - }, - "pageSizeParameterSegments": [] - } + "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "1009", - "kind": "paging", - "name": "ListWithStringNextLink", + "$id": "793", + "kind": "basic", + "name": "noContentType", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "List things with nextlink", + "doc": "Return hi again", "operation": { - "$id": "1010", - "name": "ListWithStringNextLink", + "$id": "794", + "name": "noContentType", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "List things with nextlink", + "doc": "Return hi again", "accessibility": "public", "parameters": [ { - "$id": "1011", + "$id": "795", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "p1", + "serializedName": "p1", "type": { - "$ref": "196" + "$id": "796", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, "optional": false, "isContentType": false, - "scope": "Constant", + "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", "methodParameterSegments": [ { - "$id": "1012", + "$id": "797", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "info", + "serializedName": "info", "type": { - "$ref": "196" + "$ref": "379" }, - "location": "Header", + "location": "", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec..anonymous.info", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "798", + "kind": "method", + "name": "p1", + "serializedName": "p1", + "doc": "header parameter", + "type": { + "$ref": "381" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p1", "readOnly": false, "access": "public", "decorators": [], @@ -15135,125 +11418,86 @@ } ], "isExactName": false - } - ], - "responses": [ + }, { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "445" + "$id": "799", + "kind": "path", + "name": "p2", + "serializedName": "p2", + "type": { + "$id": "800", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", + "methodParameterSegments": [ + { + "$ref": "797" + }, + { + "$id": "801", + "kind": "method", + "name": "p2", + "serializedName": "p2", + "doc": "path parameter", + "type": { + "$ref": "384" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.p2", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/linkString", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1012" - } - ], - "response": { - "type": { - "$ref": "442" - }, - "resultSegments": [ - "things" - ] - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "nextLink": { - "verb": "GET", - "responseSegments": [ - "next" - ], - "responseLocation": "Body" - }, - "pageSizeParameterSegments": [] - } - }, - { - "$id": "1013", - "kind": "paging", - "name": "ListWithContinuationToken", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "List things with continuation token", - "operation": { - "$id": "1014", - "name": "ListWithContinuationToken", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "List things with continuation token", - "accessibility": "public", - "parameters": [ + ], + "isExactName": false + }, { - "$id": "1015", - "kind": "query", - "name": "token", - "serializedName": "token", + "$id": "802", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "1016", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "124" }, "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", + "optional": false, + "isContentType": true, + "scope": "Constant", "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "methodParameterSegments": [ { - "$id": "1017", + "$id": "803", "kind": "method", - "name": "token", - "serializedName": "token", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "1018", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "124" }, - "location": "Query", + "location": "Header", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -15263,12 +11507,12 @@ "isExactName": false }, { - "$id": "1019", + "$id": "804", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "198" + "$ref": "126" }, "isApiVersion": false, "optional": false, @@ -15276,21 +11520,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "methodParameterSegments": [ { - "$id": "1020", + "$id": "805", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "198" + "$ref": "126" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "readOnly": false, "access": "public", "decorators": [], @@ -15298,6 +11542,55 @@ } ], "isExactName": false + }, + { + "$id": "806", + "kind": "body", + "name": "action", + "serializedName": "action", + "type": { + "$ref": "329" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", + "methodParameterSegments": [ + { + "$ref": "797" + }, + { + "$id": "807", + "kind": "method", + "name": "action", + "serializedName": "action", + "doc": "body parameter", + "type": { + "$ref": "329" + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Wrapper.action", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "action" + } + } } ], "responses": [ @@ -15306,7 +11599,7 @@ 200 ], "bodyType": { - "$ref": "449" + "$ref": "329" }, "headers": [], "isErrorResponse": false, @@ -15322,121 +11615,64 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/continuation", + "path": "/noContentType/{p2}", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1017" + "$ref": "797" + }, + { + "$ref": "803" }, { - "$ref": "1020" + "$ref": "805" } ], "response": { "type": { - "$ref": "442" - }, - "resultSegments": [ - "things" - ] + "$ref": "329" + } }, - "isOverride": false, + "isOverride": true, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "continuationToken": { - "parameter": { - "$ref": "1015" - }, - "responseSegments": [ - "nextToken" - ], - "responseLocation": "Body" - }, - "pageSizeParameterSegments": [] - } + "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "1021", - "kind": "paging", - "name": "ListWithContinuationTokenHeaderResponse", + "$id": "808", + "kind": "basic", + "name": "helloDemo2", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "List things with continuation token header response", + "doc": "Return hi in demo2", "operation": { - "$id": "1022", - "name": "ListWithContinuationTokenHeaderResponse", + "$id": "809", + "name": "helloDemo2", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "List things with continuation token header response", + "doc": "Return hi in demo2", "accessibility": "public", "parameters": [ { - "$id": "1023", - "kind": "query", - "name": "token", - "serializedName": "token", - "type": { - "$id": "1024", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "1025", - "kind": "method", - "name": "token", - "serializedName": "token", - "type": { - "$id": "1026", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1027", + "$id": "810", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "200" + "$ref": "128" }, "isApiVersion": false, "optional": false, @@ -15444,21 +11680,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "methodParameterSegments": [ { - "$id": "1028", + "$id": "811", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "200" + "$ref": "128" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "readOnly": false, "access": "public", "decorators": [], @@ -15474,21 +11710,9 @@ 200 ], "bodyType": { - "$ref": "453" + "$ref": "294" }, - "headers": [ - { - "name": "nextToken", - "nameInResponse": "next-token", - "type": { - "$id": "1029", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - } - ], + "headers": [], "isErrorResponse": false, "contentTypes": [ "application/json" @@ -15502,76 +11726,98 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/continuation/header", + "path": "/demoHi", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2", "decorators": [], - "namespace": "SampleTypeSpec" + "namespace": "SampleTypeSpec", + "experimental": { + "diagnosticId": "SAMPLE0001", + "dependsOn": [] + } }, "parameters": [ { - "$ref": "1025" - }, - { - "$ref": "1028" + "$ref": "811" } ], "response": { "type": { - "$ref": "442" - }, - "resultSegments": [ - "things" - ] + "$ref": "294" + } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", - "pagingMetadata": { - "itemPropertySegments": [ - "things" - ], - "continuationToken": { - "parameter": { - "$ref": "1023" - }, - "responseSegments": [ - "next-token" - ], - "responseLocation": "Header" - }, - "pageSizeParameterSegments": [] - } + "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" }, { - "$id": "1030", - "kind": "paging", - "name": "ListWithPaging", + "$id": "812", + "kind": "basic", + "name": "createLiteral", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "List things with paging", + "doc": "Create with literal value", "operation": { - "$id": "1031", - "name": "ListWithPaging", + "$id": "813", + "name": "createLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "List things with paging", + "doc": "Create with literal value", "accessibility": "public", "parameters": [ { - "$id": "1032", + "$id": "814", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "130" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", + "methodParameterSegments": [ + { + "$id": "815", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "130" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "816", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "202" + "$ref": "132" }, "isApiVersion": false, "optional": false, @@ -15579,21 +11825,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "methodParameterSegments": [ { - "$id": "1033", + "$id": "817", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "202" + "$ref": "132" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "readOnly": false, "access": "public", "decorators": [], @@ -15601,6 +11847,51 @@ } ], "isExactName": false + }, + { + "$id": "818", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "294" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", + "methodParameterSegments": [ + { + "$id": "819", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "294" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } } ], "responses": [ @@ -15609,7 +11900,7 @@ 200 ], "bodyType": { - "$ref": "455" + "$ref": "294" }, "headers": [], "isErrorResponse": false, @@ -15623,158 +11914,88 @@ } } ], - "httpMethod": "GET", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/list/paging", + "path": "/literal", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1033" + "$ref": "819" + }, + { + "$ref": "815" + }, + { + "$ref": "817" } ], "response": { "type": { - "$ref": "442" - }, - "resultSegments": [ - "items" - ] + "$ref": "294" + } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", - "pagingMetadata": { - "itemPropertySegments": [ - "items" - ], - "pageSizeParameterSegments": [] - } + "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "1034", + "$id": "820", "kind": "basic", - "name": "EmbeddedParameters", + "name": "helloLiteral", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "An operation with embedded parameters within the body", + "doc": "Send literal parameters", "operation": { - "$id": "1035", - "name": "EmbeddedParameters", + "$id": "821", + "name": "helloLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "An operation with embedded parameters within the body", + "doc": "Send literal parameters", "accessibility": "public", "parameters": [ { - "$id": "1036", + "$id": "822", "kind": "header", - "name": "requiredHeader", - "serializedName": "required-header", - "doc": "required header parameter", + "name": "p1", + "serializedName": "p1", "type": { - "$id": "1037", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "134" }, "isApiVersion": false, "optional": false, "isContentType": false, - "scope": "Method", + "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "methodParameterSegments": [ { - "$id": "1038", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "457" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - }, - { - "$id": "1039", + "$id": "823", "kind": "method", - "name": "requiredHeader", - "serializedName": "requiredHeader", - "doc": "required header parameter", + "name": "p1", + "serializedName": "p1", "type": { - "$ref": "461" + "$ref": "136" }, - "location": "", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1040", - "kind": "header", - "name": "optionalHeader", - "serializedName": "optional-header", - "doc": "optional header parameter", - "type": { - "$id": "1041", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": true, - "isContentType": false, - "scope": "Method", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", - "methodParameterSegments": [ - { - "$ref": "1038" - }, - { - "$id": "1042", - "kind": "method", - "name": "optionalHeader", - "serializedName": "optionalHeader", - "doc": "optional header parameter", - "type": { - "$ref": "463" - }, - "location": "", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "readOnly": false, "access": "public", "decorators": [], @@ -15784,43 +12005,37 @@ "isExactName": false }, { - "$id": "1043", - "kind": "query", - "name": "requiredQuery", - "serializedName": "requiredQuery", - "doc": "required query parameter", + "$id": "824", + "kind": "path", + "name": "p2", + "serializedName": "p2", "type": { - "$id": "1044", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "138" }, "isApiVersion": false, "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "scope": "Method", + "scope": "Constant", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "methodParameterSegments": [ { - "$ref": "1038" - }, - { - "$id": "1045", + "$id": "825", "kind": "method", - "name": "requiredQuery", - "serializedName": "requiredQuery", - "doc": "required query parameter", + "name": "p2", + "serializedName": "p2", "type": { - "$ref": "465" + "$ref": "140" }, - "location": "", + "location": "Path", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "readOnly": false, "access": "public", "decorators": [], @@ -15830,43 +12045,34 @@ "isExactName": false }, { - "$id": "1046", + "$id": "826", "kind": "query", - "name": "optionalQuery", - "serializedName": "optionalQuery", - "doc": "optional query parameter", + "name": "p3", + "serializedName": "p3", "type": { - "$id": "1047", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "142" }, "isApiVersion": false, "explode": false, - "optional": true, - "scope": "Method", + "optional": false, + "scope": "Constant", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", "readOnly": false, "methodParameterSegments": [ { - "$ref": "1038" - }, - { - "$id": "1048", + "$id": "827", "kind": "method", - "name": "optionalQuery", - "serializedName": "optionalQuery", - "doc": "optional query parameter", + "name": "p3", + "serializedName": "p3", "type": { - "$ref": "467" + "$ref": "144" }, - "location": "", + "location": "Query", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p3", "readOnly": false, "access": "public", "decorators": [], @@ -15876,36 +12082,34 @@ "isExactName": false }, { - "$id": "1049", + "$id": "828", "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "204" + "$ref": "146" }, "isApiVersion": false, "optional": false, - "isContentType": true, + "isContentType": false, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "methodParameterSegments": [ { - "$id": "1050", + "$id": "829", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "204" + "$ref": "146" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "readOnly": false, "access": "public", "decorators": [], @@ -15913,125 +12117,137 @@ } ], "isExactName": false - }, + } + ], + "responses": [ { - "$id": "1051", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "457" + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "294" }, - "isApiVersion": false, + "headers": [], + "isErrorResponse": false, "contentTypes": [ "application/json" ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", - "methodParameterSegments": [ - { - "$ref": "1038" - } - ], - "isExactName": false, "serializationOptions": { "json": { - "name": "body" + "name": "" } } } ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/embeddedParameters", - "requestMediaTypes": [ - "application/json" - ], + "path": "/helloLiteral/{p2}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters", + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1038" + "$ref": "823" + }, + { + "$ref": "825" }, { - "$ref": "1050" + "$ref": "827" + }, + { + "$ref": "829" } ], - "response": {}, + "response": { + "type": { + "$ref": "294" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" + "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "1052", + "$id": "830", "kind": "basic", - "name": "DynamicModelOperation", + "name": "topAction", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "An operation with a dynamic model", + "doc": "top level method", "operation": { - "$id": "1053", - "name": "DynamicModelOperation", + "$id": "831", + "name": "topAction", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "An operation with a dynamic model", + "doc": "top level method", "accessibility": "public", "parameters": [ { - "$id": "1054", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "832", + "kind": "path", + "name": "action", + "serializedName": "action", "type": { - "$ref": "206" + "$id": "833", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] }, "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "methodParameterSegments": [ { - "$id": "1055", + "$id": "835", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "action", + "serializedName": "action", "type": { - "$ref": "206" + "$id": "836", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "837", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] }, - "location": "Header", + "location": "Path", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "readOnly": false, "access": "public", "decorators": [], @@ -16041,120 +12257,117 @@ "isExactName": false }, { - "$id": "1056", - "kind": "body", - "name": "body", - "serializedName": "body", + "$id": "838", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "468" + "$ref": "148" }, "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, - "scope": "Method", - "decorators": [], + "isContentType": false, + "scope": "Constant", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "methodParameterSegments": [ { - "$id": "1057", + "$id": "839", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "468" + "$ref": "148" }, - "location": "Body", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "readOnly": false, "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } + "isExactName": false } ], "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "294" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "POST", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/dynamicModel", - "requestMediaTypes": [ - "application/json" - ], + "path": "/top/{action}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction", "decorators": [], - "namespace": "SampleTypeSpec", - "experimental": { - "diagnosticId": "SAMPLE0002", - "dependsOn": [ - "SCME0001" - ] - } + "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1057" + "$ref": "835" }, { - "$ref": "1055" + "$ref": "839" } ], - "response": {}, + "response": { + "type": { + "$ref": "294" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" + "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "1058", + "$id": "840", "kind": "basic", - "name": "GetXmlAdvancedModel", + "name": "topAction2", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Get an advanced XML model with various property types", + "doc": "top level method2", "operation": { - "$id": "1059", - "name": "GetXmlAdvancedModel", + "$id": "841", + "name": "topAction2", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Get an advanced XML model with various property types", + "doc": "top level method2", "accessibility": "public", "parameters": [ { - "$id": "1060", + "$id": "842", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "208" + "$ref": "150" }, "isApiVersion": false, "optional": false, @@ -16162,21 +12375,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "methodParameterSegments": [ { - "$id": "1061", + "$id": "843", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "208" + "$ref": "150" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "readOnly": false, "access": "public", "decorators": [], @@ -16184,31 +12397,23 @@ } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "506" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "210" - } - } + } + ], + "responses": [ + { + "statusCodes": [ + 200 ], + "bodyType": { + "$ref": "294" + }, + "headers": [], "isErrorResponse": false, "contentTypes": [ - "application/xml" + "application/json" ], "serializationOptions": { - "xml": { + "json": { "name": "" } } @@ -16216,55 +12421,56 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/xmlAdvanced", + "path": "/top2", "bufferResponse": true, "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel", + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1061" + "$ref": "843" } ], "response": { "type": { - "$ref": "506" + "$ref": "294" } }, "isOverride": false, - "generateConvenient": true, + "generateConvenient": false, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" + "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" }, { - "$id": "1062", + "$id": "844", "kind": "basic", - "name": "UpdateXmlAdvancedModel", + "name": "patchAction", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Update an advanced XML model with various property types", + "doc": "top level patch", "operation": { - "$id": "1063", - "name": "UpdateXmlAdvancedModel", + "$id": "845", + "name": "patchAction", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Update an advanced XML model with various property types", + "doc": "top level patch", "accessibility": "public", "parameters": [ { - "$id": "1064", + "$id": "846", "kind": "header", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "152" }, "isApiVersion": false, "optional": false, @@ -16272,21 +12478,22 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "methodParameterSegments": [ { - "$id": "1065", + "$id": "847", "kind": "method", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "152" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -16296,12 +12503,12 @@ "isExactName": false }, { - "$id": "1066", + "$id": "848", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "216" + "$ref": "154" }, "isApiVersion": false, "optional": false, @@ -16309,21 +12516,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "methodParameterSegments": [ { - "$id": "1067", + "$id": "849", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "216" + "$ref": "154" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "readOnly": false, "access": "public", "decorators": [], @@ -16333,37 +12540,37 @@ "isExactName": false }, { - "$id": "1068", + "$id": "850", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "506" + "$ref": "294" }, "isApiVersion": false, "contentTypes": [ - "application/xml" + "application/json" ], - "defaultContentType": "application/xml", + "defaultContentType": "application/json", "optional": false, "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "methodParameterSegments": [ { - "$id": "1069", + "$id": "851", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "506" + "$ref": "294" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "readOnly": false, "access": "public", "decorators": [], @@ -16372,7 +12579,7 @@ ], "isExactName": false, "serializationOptions": { - "xml": { + "json": { "name": "body" } } @@ -16384,86 +12591,155 @@ 200 ], "bodyType": { - "$ref": "506" + "$ref": "294" }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "218" - } - } - ], + "headers": [], "isErrorResponse": false, "contentTypes": [ - "application/xml" + "application/json" ], "serializationOptions": { - "xml": { + "json": { "name": "" } } } ], - "httpMethod": "PUT", + "httpMethod": "PATCH", "uri": "{sampleTypeSpecUrl}", - "path": "/xmlAdvanced", + "path": "/patch", "requestMediaTypes": [ - "application/xml" + "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel", + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1069" + "$ref": "851" }, { - "$ref": "1065" + "$ref": "847" }, { - "$ref": "1067" + "$ref": "849" } ], "response": { "type": { - "$ref": "506" + "$ref": "294" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" + "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "1070", + "$id": "852", "kind": "basic", - "name": "uploadCat", + "name": "anonymousBody", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "body parameter without body decorator", "operation": { - "$id": "1071", - "name": "uploadCat", + "$id": "853", + "name": "anonymousBody", "isExactName": false, "resourceName": "SampleTypeSpec", + "doc": "body parameter without body decorator", "accessibility": "public", "parameters": [ { - "$id": "1072", + "$id": "854", + "kind": "query", + "name": "requiredQueryParam", + "serializedName": "requiredQueryParam", + "type": { + "$ref": "156" + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Constant", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "855", + "kind": "method", + "name": "requiredQueryParam", + "serializedName": "requiredQueryParam", + "type": { + "$ref": "158" + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredQueryParam", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "856", + "kind": "header", + "name": "requiredHeader", + "serializedName": "required-header", + "type": { + "$ref": "160" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", + "methodParameterSegments": [ + { + "$id": "857", + "kind": "method", + "name": "requiredHeader", + "serializedName": "required-header", + "type": { + "$ref": "162" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "858", "kind": "header", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "164" }, "isApiVersion": false, "optional": false, @@ -16471,21 +12747,59 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", "methodParameterSegments": [ { - "$id": "1073", + "$id": "859", "kind": "method", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "164" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "860", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "166" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", + "methodParameterSegments": [ + { + "$id": "861", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "166" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", "readOnly": false, "access": "public", "decorators": [], @@ -16495,37 +12809,42 @@ "isExactName": false }, { - "$id": "1074", + "$id": "862", "kind": "body", - "name": "body", - "serializedName": "body", + "name": "thing", + "serializedName": "thing", "type": { - "$ref": "602" + "$ref": "294" }, "isApiVersion": false, "contentTypes": [ - "multipart/form-data" + "application/json" ], - "defaultContentType": "multipart/form-data", + "defaultContentType": "application/json", "optional": false, - "scope": "Method", + "scope": "Spread", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", "methodParameterSegments": [ { - "$id": "1075", + "$id": "863", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "name", + "serializedName": "name", + "doc": "name of the Thing", "type": { - "$ref": "602" + "$id": "864", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.name", "readOnly": false, "access": "public", "decorators": [], @@ -16533,267 +12852,549 @@ } ], "isExactName": false, - "serializationOptions": {} + "serializationOptions": { + "json": { + "name": "" + } + } } ], "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "294" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/cats", + "path": "/anonymousBody", "requestMediaTypes": [ - "multipart/form-data" + "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1073" + "$ref": "863" }, { - "$ref": "1075" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" - }, - { - "$id": "1076", - "kind": "basic", - "name": "sendJsonLines", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1077", - "name": "sendJsonLines", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ - { - "$id": "1078", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "224" + "$id": "865", + "kind": "method", + "name": "requiredUnion", + "serializedName": "requiredUnion", + "doc": "required Union", + "type": { + "$ref": "298" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredUnion", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "866", + "kind": "method", + "name": "requiredLiteralString", + "serializedName": "requiredLiteralString", + "doc": "required literal string", + "type": { + "$ref": "100" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "867", + "kind": "method", + "name": "requiredNullableString", + "serializedName": "requiredNullableString", + "doc": "required nullable string", + "type": { + "$ref": "305" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "868", + "kind": "method", + "name": "optionalNullableString", + "serializedName": "optionalNullableString", + "doc": "required optional string", + "type": { + "$ref": "308" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "869", + "kind": "method", + "name": "requiredLiteralInt", + "serializedName": "requiredLiteralInt", + "doc": "required literal int", + "type": { + "$ref": "102" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralInt", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "870", + "kind": "method", + "name": "requiredLiteralFloat", + "serializedName": "requiredLiteralFloat", + "doc": "required literal float", + "type": { + "$ref": "104" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralFloat", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "871", + "kind": "method", + "name": "requiredLiteralBool", + "serializedName": "requiredLiteralBool", + "doc": "required literal bool", + "type": { + "$ref": "106" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredLiteralBool", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "872", + "kind": "method", + "name": "optionalLiteralString", + "serializedName": "optionalLiteralString", + "doc": "optional literal string", + "type": { + "$id": "873", + "kind": "enum", + "name": "ThingOptionalLiteralString", + "apiVersions": [], + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "874", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", - "methodParameterSegments": [ + "values": [ { - "$id": "1079", - "kind": "method", - "name": "stream", - "serializedName": "stream", - "type": { - "$id": "1080", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "647" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + "$id": "875", + "kind": "enumvalue", + "name": "reject", + "value": "reject", + "valueType": { + "$id": "876", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "enumType": { + "$ref": "873" }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines.stream", - "readOnly": false, - "access": "public", "decorators": [], "isExactName": false - }, + } + ], + "namespace": "SampleTypeSpec", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [], + "isExactName": false + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "877", + "kind": "method", + "name": "requiredNullableLiteralString", + "serializedName": "requiredNullableLiteralString", + "doc": "required nullable literal string", + "type": { + "$ref": "315" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableLiteralString", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "878", + "kind": "method", + "name": "optionalLiteralInt", + "serializedName": "optionalLiteralInt", + "doc": "optional literal int", + "type": { + "$id": "879", + "kind": "enum", + "name": "ThingOptionalLiteralInt", + "apiVersions": [], + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "880", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "values": [ { - "$id": "1081", - "kind": "method", - "name": "contentType", - "serializedName": "contentType", - "type": { - "$ref": "226" + "$id": "881", + "kind": "enumvalue", + "name": "456", + "value": 456, + "valueType": { + "$id": "882", + "kind": "int32", + "decorators": [], + "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32" + }, + "enumType": { + "$ref": "879" }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", - "readOnly": false, - "access": "public", "decorators": [], "isExactName": false } ], + "namespace": "SampleTypeSpec", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [], "isExactName": false }, - { - "$id": "1082", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$id": "1083", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "647" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralInt", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "883", + "kind": "method", + "name": "optionalLiteralFloat", + "serializedName": "optionalLiteralFloat", + "doc": "optional literal float", + "type": { + "$id": "884", + "kind": "enum", + "name": "ThingOptionalLiteralFloat", + "apiVersions": [], + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "885", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] }, - "isApiVersion": false, - "contentTypes": [ - "application/jsonl" - ], - "defaultContentType": "application/jsonl", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", - "methodParameterSegments": [ - { - "$ref": "1079" - }, + "values": [ { - "$id": "1084", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "807" + "$id": "886", + "kind": "enumvalue", + "name": "4.56", + "value": 4.56, + "valueType": { + "$id": "887", + "kind": "float32", + "decorators": [], + "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32" + }, + "enumType": { + "$ref": "884" }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", - "readOnly": false, - "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/streaming/jsonl/send", - "requestMediaTypes": [ - "application/jsonl" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ + "namespace": "SampleTypeSpec", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [], + "isExactName": false + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralFloat", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "888", + "kind": "method", + "name": "optionalLiteralBool", + "serializedName": "optionalLiteralBool", + "doc": "optional literal bool", + "type": { + "$ref": "108" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalLiteralBool", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "889", + "kind": "method", + "name": "requiredBadDescription", + "serializedName": "requiredBadDescription", + "doc": "description with xml <|endoftext|>", + "type": { + "$id": "890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredBadDescription", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "891", + "kind": "method", + "name": "optionalNullableList", + "serializedName": "optionalNullableList", + "doc": "optional nullable collection", + "type": { + "$ref": "322" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.optionalNullableList", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "892", + "kind": "method", + "name": "requiredNullableList", + "serializedName": "requiredNullableList", + "doc": "required nullable collection", + "type": { + "$ref": "326" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredNullableList", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "893", + "kind": "method", + "name": "propertyWithSpecialDocs", + "serializedName": "propertyWithSpecialDocs", + "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", + "type": { + "$id": "894", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.propertyWithSpecialDocs", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$ref": "855" + }, + { + "$ref": "857" + }, + { + "$ref": "859" + }, { - "$ref": "1079" + "$ref": "861" } ], - "response": {}, + "response": { + "type": { + "$ref": "294" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" + "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "1085", + "$id": "895", "kind": "basic", - "name": "receiveJsonLines", + "name": "friendlyModel", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Model can have its friendly name", "operation": { - "$id": "1086", - "name": "receiveJsonLines", + "$id": "896", + "name": "friendlyModel", "isExactName": false, "resourceName": "SampleTypeSpec", + "doc": "Model can have its friendly name", "accessibility": "public", "parameters": [ { - "$id": "1087", + "$id": "897", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "178" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "methodParameterSegments": [ { - "$id": "1088", + "$id": "898", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "178" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -16801,105 +13402,14 @@ } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1089", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "647" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "230" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/jsonl" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/streaming/jsonl/receive", - "bufferResponse": false, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1088" - } - ], - "response": { - "type": { - "$id": "1090", - "kind": "streaming", - "name": "JsonlStreamStreamingItem", - "valueType": { - "$ref": "647" }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" - }, - { - "$id": "1091", - "kind": "basic", - "name": "receiveSse", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1092", - "name": "receiveSse", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "accessibility": "public", - "parameters": [ { - "$id": "1093", + "$id": "899", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "180" }, "isApiVersion": false, "optional": false, @@ -16907,21 +13417,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "methodParameterSegments": [ { - "$id": "1094", + "$id": "900", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "180" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -16929,6 +13439,56 @@ } ], "isExactName": false + }, + { + "$id": "901", + "kind": "body", + "name": "friend", + "serializedName": "friend", + "type": { + "$ref": "385" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Spread", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", + "methodParameterSegments": [ + { + "$id": "902", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "name of the NotFriend", + "type": { + "$id": "903", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.name", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "" + } + } } ], "responses": [ @@ -16937,88 +13497,58 @@ 200 ], "bodyType": { - "$id": "1095", - "kind": "streaming", - "name": "SSEStreamSampleEvents", - "valueType": { - "$id": "1096", - "kind": "union", - "name": "SampleEvents", - "variantTypes": [ - { - "$ref": "647" - }, - { - "$ref": "234" - } - ], - "namespace": "SampleTypeSpec", - "decorators": [], - "isExactName": false - }, - "streamKind": "sse", - "contentTypes": [ - "text/event-stream" - ], - "terminalEventValue": "[DONE]", - "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" + "$ref": "385" }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "236" - } - } - ], + "headers": [], "isErrorResponse": false, "contentTypes": [ - "text/event-stream" + "application/json" ], - "serializationOptions": {} + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "GET", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/streaming/sse/receive", - "bufferResponse": false, + "path": "/friendlyName", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse", + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1094" + "$ref": "902" + }, + { + "$ref": "898" + }, + { + "$ref": "900" } ], "response": { "type": { - "$id": "1097", - "kind": "streaming", - "name": "SSEStreamSampleEvents", - "valueType": { - "$ref": "1096" - }, - "streamKind": "sse", - "contentTypes": [ - "text/event-stream" - ], - "terminalEventValue": "[DONE]", - "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" + "$ref": "385" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" + "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "1098", + "$id": "904", "kind": "basic", - "name": "receiveExperimentalJsonLines", + "name": "addTimeHeader", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -17026,41 +13556,65 @@ "2024-08-16-preview" ], "operation": { - "$id": "1099", - "name": "receiveExperimentalJsonLines", + "$id": "905", + "name": "addTimeHeader", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "1100", + "$id": "906", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "repeatabilityFirstSent", + "serializedName": "Repeatability-First-Sent", "type": { - "$ref": "238" + "$id": "907", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "908", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] }, "isApiVersion": false, - "optional": false, + "optional": true, "isContentType": false, - "scope": "Constant", + "scope": "Method", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "methodParameterSegments": [ { - "$id": "1101", + "$id": "909", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "repeatabilityFirstSent", + "serializedName": "Repeatability-First-Sent", "type": { - "$ref": "238" + "$id": "910", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "911", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] }, "location": "Header", "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "readOnly": false, "access": "public", "decorators": [], @@ -17073,135 +13627,84 @@ "responses": [ { "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1102", - "kind": "streaming", - "name": "JsonlStreamPreviewDetails", - "valueType": { - "$ref": "650" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "240" - } - } + 204 ], + "headers": [], "isErrorResponse": false, - "contentTypes": [ - "application/jsonl" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "serializationOptions": {} } ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/experimental/jsonl", - "bufferResponse": false, + "path": "/", + "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines", + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1101" + "$ref": "909" } ], - "response": { - "type": { - "$id": "1103", - "kind": "streaming", - "name": "JsonlStreamPreviewDetails", - "valueType": { - "$ref": "650" - }, - "streamKind": "jsonl", - "contentTypes": [ - "application/jsonl" - ], - "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" - } - }, + "response": {}, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines" + "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" }, { - "$id": "1104", + "$id": "912", "kind": "basic", - "name": "getAcronymParameters", + "name": "projectedNameModel", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Send acronym-named path, query, and header parameters.", + "doc": "Model can have its projected name", "operation": { - "$id": "1105", - "name": "getAcronymParameters", + "$id": "913", + "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Send acronym-named path, query, and header parameters.", + "doc": "Model can have its projected name", "accessibility": "public", "parameters": [ { - "$id": "1106", - "kind": "path", - "name": "targetDbName", - "serializedName": "targetDbName", + "$id": "914", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "1107", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "182" }, "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, "optional": false, - "scope": "Method", - "decorators": [], + "isContentType": true, + "scope": "Constant", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "methodParameterSegments": [ { - "$id": "1108", + "$id": "915", "kind": "method", - "name": "targetDbName", - "serializedName": "targetDbName", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$id": "1109", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "182" }, - "location": "Path", + "location": "Header", "isApiVersion": false, "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -17211,42 +13714,34 @@ "isExactName": false }, { - "$id": "1110", - "kind": "query", - "name": "sourceIpAddress", - "serializedName": "sourceIpAddress", + "$id": "916", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1111", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "184" }, "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", + "optional": false, + "isContentType": false, + "scope": "Constant", "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "1112", + "$id": "917", "kind": "method", - "name": "sourceIpAddress", - "serializedName": "sourceIpAddress", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1113", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "184" }, - "location": "Query", + "location": "Header", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -17256,189 +13751,158 @@ "isExactName": false }, { - "$id": "1114", - "kind": "header", - "name": "guestOsType", - "serializedName": "X-Guest-OS-Type", + "$id": "918", + "kind": "body", + "name": "renamedModel", + "serializedName": "renamedModel", "type": { - "$id": "1115", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "388" }, "isApiVersion": false, - "optional": true, - "isContentType": false, - "scope": "Method", - "readOnly": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Spread", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "1116", + "$id": "919", "kind": "method", - "name": "guestOsType", - "serializedName": "X-Guest-OS-Type", + "name": "otherName", + "serializedName": "otherName", + "doc": "name of the ModelWithClientName", "type": { - "$id": "1117", + "$id": "920", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "location": "Header", + "location": "Body", "isApiVersion": false, - "optional": true, + "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.otherName", "readOnly": false, "access": "public", "decorators": [], "isExactName": false } ], - "isExactName": false + "isExactName": false, + "serializationOptions": { + "json": { + "name": "" + } + } } ], "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "388" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "GET", + "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/acronyms/{targetDbName}", + "path": "/projectedName", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters", + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1108" + "$ref": "919" }, { - "$ref": "1112" + "$ref": "915" }, { - "$ref": "1116" + "$ref": "917" } ], - "response": {}, + "response": { + "type": { + "$ref": "388" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters" + "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" }, { - "$id": "1118", + "$id": "921", "kind": "basic", - "name": "setAcronymAddresses", + "name": "returnsAnonymousModel", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "doc": "Send parameters with leading IP version acronyms.", + "doc": "return anonymous model", "operation": { - "$id": "1119", - "name": "setAcronymAddresses", + "$id": "922", + "name": "returnsAnonymousModel", "isExactName": false, "resourceName": "SampleTypeSpec", - "doc": "Send parameters with leading IP version acronyms.", + "doc": "return anonymous model", "accessibility": "public", "parameters": [ { - "$id": "1120", - "kind": "query", - "name": "ipV4Address", - "serializedName": "ipV4Address", + "$id": "923", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1121", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "186" }, "isApiVersion": false, - "explode": false, "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", + "isContentType": false, + "scope": "Constant", "readOnly": false, - "methodParameterSegments": [ - { - "$id": "1122", - "kind": "method", - "name": "ipV4Address", - "serializedName": "ipV4Address", - "type": { - "$id": "1123", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, - { - "$id": "1124", - "kind": "query", - "name": "ipV6Address", - "serializedName": "ipV6Address", - "type": { - "$id": "1125", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", - "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "1126", + "$id": "924", "kind": "method", - "name": "ipV6Address", - "serializedName": "ipV6Address", + "name": "accept", + "serializedName": "Accept", "type": { - "$id": "1127", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "186" }, - "location": "Query", + "location": "Header", "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "readOnly": false, "access": "public", "decorators": [], @@ -17451,3505 +13915,3211 @@ "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "391" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], "httpMethod": "POST", "uri": "{sampleTypeSpecUrl}", - "path": "/acronyms/addresses", + "path": "/returnsAnonymousModel", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses", + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1122" - }, - { - "$ref": "1126" + "$ref": "924" } ], - "response": {}, + "response": { + "type": { + "$ref": "391" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses" - } - ], - "parameters": [ - { - "$id": "1128", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1129", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.sampleTypeSpecUrl", - "isExactName": false + "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" }, { - "$ref": "1002" - } - ], - "initializedBy": 1, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "children": [ - { - "$id": "1130", - "kind": "client", - "name": "ExperimentalSamples", + "$id": "925", + "kind": "basic", + "name": "getUnknownValue", "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1131", - "kind": "basic", - "name": "read", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1132", - "name": "read", - "isExactName": false, - "resourceName": "ExperimentalSamples", - "accessibility": "public", - "parameters": [ - { - "$id": "1133", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "242" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", - "methodParameterSegments": [ - { - "$id": "1134", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "242" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "652" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/experimental", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1134" - } - ], - "response": { + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "get extensible enum", + "operation": { + "$id": "926", + "name": "getUnknownValue", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "get extensible enum", + "accessibility": "public", + "parameters": [ + { + "$id": "927", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "652" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read" - }, - { - "$id": "1135", - "kind": "paging", - "name": "list", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1136", - "name": "list", - "isExactName": false, - "resourceName": "ExperimentalSamples", - "accessibility": "public", - "parameters": [ + "$ref": "188" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", + "methodParameterSegments": [ { - "$id": "1137", - "kind": "header", + "$id": "928", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "188" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", - "methodParameterSegments": [ - { - "$id": "1138", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "244" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "655" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/experimental/pages", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1138" - } - ], - "response": { - "type": { - "$ref": "657" + "bodyType": { + "$ref": "87" }, - "resultSegments": [ - "items" - ] - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", - "pagingMetadata": { - "itemPropertySegments": [ - "items" + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "text/plain" ], - "pageSizeParameterSegments": [] + "serializationOptions": {} } - } - ], + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/unknown-value", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1139", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1140", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.sampleTypeSpecUrl", - "isExactName": false + "$ref": "928" } ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "808" + "response": { + "type": { + "$ref": "87" + } }, - "isMultiServiceClient": false, - "experimental": { - "diagnosticId": "SAMPLE0009", - "dependsOn": [] - } + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "1141", - "kind": "client", - "name": "AnimalOperations", + "$id": "929", + "kind": "basic", + "name": "internalProtocol", "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1142", - "kind": "basic", - "name": "updatePetAsAnimal", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a pet as an animal", - "operation": { - "$id": "1143", - "name": "updatePetAsAnimal", - "isExactName": false, - "resourceName": "AnimalOperations", - "doc": "Update a pet as an animal", - "accessibility": "public", - "parameters": [ + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "When set protocol false and convenient true, then the protocol method should be internal", + "operation": { + "$id": "930", + "name": "internalProtocol", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "When set protocol false and convenient true, then the protocol method should be internal", + "accessibility": "public", + "parameters": [ + { + "$id": "931", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "190" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", + "methodParameterSegments": [ { - "$id": "1144", - "kind": "header", + "$id": "932", + "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "246" + "$ref": "190" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": true, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", - "methodParameterSegments": [ - { - "$id": "1145", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "246" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "933", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "192" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", + "methodParameterSegments": [ { - "$id": "1146", - "kind": "header", + "$id": "934", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "192" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", - "methodParameterSegments": [ - { - "$id": "1147", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "248" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "935", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "294" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", + "methodParameterSegments": [ { - "$id": "1148", - "kind": "body", - "name": "animal", - "serializedName": "animal", + "$id": "936", + "kind": "method", + "name": "body", + "serializedName": "body", "type": { - "$ref": "658" + "$ref": "294" }, + "location": "Body", "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, "scope": "Method", - "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", - "methodParameterSegments": [ - { - "$id": "1149", - "kind": "method", - "name": "animal", - "serializedName": "animal", - "type": { - "$ref": "658" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "animal" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "658" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/animals/pet/as-animal", - "requestMediaTypes": [ + "bodyType": { + "$ref": "294" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ "application/json" ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1149" - }, - { - "$ref": "1145" - }, - { - "$ref": "1147" + "serializationOptions": { + "json": { + "name": "" + } } - ], - "response": { + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/internalProtocol", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": false, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "936" + }, + { + "$ref": "932" + }, + { + "$ref": "934" + } + ], + "response": { + "type": { + "$ref": "294" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": false, + "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" + }, + { + "$id": "937", + "kind": "basic", + "name": "stillConvenient", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", + "operation": { + "$id": "938", + "name": "stillConvenient", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", + "accessibility": "public", + "parameters": [], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/stillConvenient", + "bufferResponse": true, + "generateProtocolMethod": false, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": false, + "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" + }, + { + "$id": "939", + "kind": "basic", + "name": "headAsBoolean", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "head as boolean.", + "operation": { + "$id": "940", + "name": "headAsBoolean", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "head as boolean.", + "accessibility": "public", + "parameters": [ + { + "$id": "941", + "kind": "path", + "name": "id", + "serializedName": "id", "type": { - "$ref": "658" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" - }, - { - "$id": "1150", - "kind": "basic", - "name": "updateDogAsAnimal", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a dog as an animal", - "operation": { - "$id": "1151", - "name": "updateDogAsAnimal", - "isExactName": false, - "resourceName": "AnimalOperations", - "doc": "Update a dog as an animal", - "accessibility": "public", - "parameters": [ - { - "$id": "1152", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "250" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", - "methodParameterSegments": [ - { - "$id": "1153", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "250" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, + "$id": "942", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", + "methodParameterSegments": [ { - "$id": "1154", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "943", + "kind": "method", + "name": "id", + "serializedName": "id", "type": { - "$ref": "252" + "$id": "944", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Path", "isApiVersion": false, "optional": false, - "isContentType": false, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", - "methodParameterSegments": [ - { - "$id": "1155", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "252" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "HEAD", + "uri": "{sampleTypeSpecUrl}", + "path": "/headAsBoolean/{id}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "943" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" + }, + { + "$id": "945", + "kind": "basic", + "name": "WithApiVersion", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Return hi again", + "operation": { + "$id": "946", + "name": "WithApiVersion", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Return hi again", + "accessibility": "public", + "parameters": [ + { + "$id": "947", + "kind": "header", + "name": "p1", + "serializedName": "p1", + "type": { + "$id": "948", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", + "methodParameterSegments": [ { - "$id": "1156", - "kind": "body", - "name": "animal", - "serializedName": "animal", + "$id": "949", + "kind": "method", + "name": "p1", + "serializedName": "p1", "type": { - "$ref": "658" + "$id": "950", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Header", "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, "scope": "Method", - "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", - "methodParameterSegments": [ - { - "$id": "1157", - "kind": "method", - "name": "animal", - "serializedName": "animal", - "type": { - "$ref": "658" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "animal" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "658" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/animals/dog/as-animal", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal", - "decorators": [], - "namespace": "SampleTypeSpec" + "isExactName": false }, - "parameters": [ - { - "$ref": "1157" + { + "$id": "951", + "kind": "query", + "name": "apiVersion", + "serializedName": "apiVersion", + "type": { + "$id": "952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - { - "$ref": "1153" + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "953", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-08-16-preview" }, - { - "$ref": "1155" - } - ], - "response": { - "type": { - "$ref": "658" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal" - } - ], + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "954", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "type": { + "$id": "955", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "956", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-08-16-preview" + }, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/WithApiVersion", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1158", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1159", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.sampleTypeSpecUrl", - "isExactName": false + "$ref": "949" } ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations", + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" + }, + { + "$id": "957", + "kind": "paging", + "name": "ListWithNextLink", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "parent": { - "$ref": "808" - }, - "isMultiServiceClient": false - }, - { - "$id": "1160", - "kind": "client", - "name": "PetOperations", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1161", - "kind": "basic", - "name": "updatePetAsPet", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a pet as a pet", - "operation": { - "$id": "1162", - "name": "updatePetAsPet", - "isExactName": false, - "resourceName": "PetOperations", - "doc": "Update a pet as a pet", - "accessibility": "public", - "parameters": [ + "doc": "List things with nextlink", + "operation": { + "$id": "958", + "name": "ListWithNextLink", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with nextlink", + "accessibility": "public", + "parameters": [ + { + "$id": "959", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "194" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", + "methodParameterSegments": [ { - "$id": "1163", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "960", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "254" + "$ref": "194" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": true, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", - "methodParameterSegments": [ - { - "$id": "1164", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "254" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "392" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/link", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "960" + } + ], + "response": { + "type": { + "$ref": "394" + }, + "resultSegments": [ + "things" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "nextLink": { + "verb": "GET", + "responseSegments": [ + "next" + ], + "responseLocation": "Body" + }, + "pageSizeParameterSegments": [] + } + }, + { + "$id": "961", + "kind": "paging", + "name": "ListWithStringNextLink", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "List things with nextlink", + "operation": { + "$id": "962", + "name": "ListWithStringNextLink", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with nextlink", + "accessibility": "public", + "parameters": [ + { + "$id": "963", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "196" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", + "methodParameterSegments": [ { - "$id": "1165", - "kind": "header", + "$id": "964", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "196" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", - "methodParameterSegments": [ - { - "$id": "1166", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "256" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "397" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/linkString", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "964" + } + ], + "response": { + "type": { + "$ref": "394" + }, + "resultSegments": [ + "things" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "nextLink": { + "verb": "GET", + "responseSegments": [ + "next" + ], + "responseLocation": "Body" + }, + "pageSizeParameterSegments": [] + } + }, + { + "$id": "965", + "kind": "paging", + "name": "ListWithContinuationToken", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "List things with continuation token", + "operation": { + "$id": "966", + "name": "ListWithContinuationToken", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with continuation token", + "accessibility": "public", + "parameters": [ + { + "$id": "967", + "kind": "query", + "name": "token", + "serializedName": "token", + "type": { + "$id": "968", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", + "readOnly": false, + "methodParameterSegments": [ { - "$id": "1167", - "kind": "body", - "name": "pet", - "serializedName": "pet", + "$id": "969", + "kind": "method", + "name": "token", + "serializedName": "token", "type": { - "$ref": "663" + "$id": "970", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Query", "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, + "optional": true, "scope": "Method", - "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.token", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", - "methodParameterSegments": [ - { - "$id": "1168", - "kind": "method", - "name": "pet", - "serializedName": "pet", - "type": { - "$ref": "663" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "pet" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "663" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/pets/pet/as-pet", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet", - "decorators": [], - "namespace": "SampleTypeSpec" + "isExactName": false }, - "parameters": [ - { - "$ref": "1168" - }, - { - "$ref": "1164" - }, - { - "$ref": "1166" - } - ], - "response": { + { + "$id": "971", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "663" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" - }, - { - "$id": "1169", - "kind": "basic", - "name": "updateDogAsPet", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a dog as a pet", - "operation": { - "$id": "1170", - "name": "updateDogAsPet", - "isExactName": false, - "resourceName": "PetOperations", - "doc": "Update a dog as a pet", - "accessibility": "public", - "parameters": [ + "$ref": "198" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", + "methodParameterSegments": [ { - "$id": "1171", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "972", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "258" + "$ref": "198" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": true, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", - "methodParameterSegments": [ - { - "$id": "1172", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "258" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "401" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/continuation", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "969" + }, + { + "$ref": "972" + } + ], + "response": { + "type": { + "$ref": "394" + }, + "resultSegments": [ + "things" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "continuationToken": { + "parameter": { + "$ref": "967" + }, + "responseSegments": [ + "nextToken" + ], + "responseLocation": "Body" + }, + "pageSizeParameterSegments": [] + } + }, + { + "$id": "973", + "kind": "paging", + "name": "ListWithContinuationTokenHeaderResponse", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "List things with continuation token header response", + "operation": { + "$id": "974", + "name": "ListWithContinuationTokenHeaderResponse", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with continuation token header response", + "accessibility": "public", + "parameters": [ + { + "$id": "975", + "kind": "query", + "name": "token", + "serializedName": "token", + "type": { + "$id": "976", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", + "readOnly": false, + "methodParameterSegments": [ { - "$id": "1173", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "977", + "kind": "method", + "name": "token", + "serializedName": "token", "type": { - "$ref": "260" + "$id": "978", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Query", "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.token", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", - "methodParameterSegments": [ - { - "$id": "1174", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "260" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "979", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "200" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", + "methodParameterSegments": [ { - "$id": "1175", - "kind": "body", - "name": "pet", - "serializedName": "pet", + "$id": "980", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "663" + "$ref": "200" }, + "location": "Header", "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, - "scope": "Method", - "decorators": [], + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", - "methodParameterSegments": [ - { - "$id": "1176", - "kind": "method", - "name": "pet", - "serializedName": "pet", - "type": { - "$ref": "663" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "pet" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "responses": [ + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "405" + }, + "headers": [ { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "663" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } + "name": "nextToken", + "nameInResponse": "next-token", + "type": { + "$id": "981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] } } ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/pets/dog/as-pet", - "requestMediaTypes": [ + "isErrorResponse": false, + "contentTypes": [ "application/json" ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1176" - }, - { - "$ref": "1172" - }, - { - "$ref": "1174" - } - ], - "response": { - "type": { - "$ref": "663" + "serializationOptions": { + "json": { + "name": "" + } } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet" - } - ], + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/continuation/header", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1177", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1178", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.sampleTypeSpecUrl", - "isExactName": false + "$ref": "977" + }, + { + "$ref": "980" } ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "808" + "response": { + "type": { + "$ref": "394" + }, + "resultSegments": [ + "things" + ] }, - "isMultiServiceClient": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse", + "pagingMetadata": { + "itemPropertySegments": [ + "things" + ], + "continuationToken": { + "parameter": { + "$ref": "975" + }, + "responseSegments": [ + "next-token" + ], + "responseLocation": "Header" + }, + "pageSizeParameterSegments": [] + } }, { - "$id": "1179", - "kind": "client", - "name": "DogOperations", + "$id": "982", + "kind": "paging", + "name": "ListWithPaging", "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1180", - "kind": "basic", - "name": "updateDogAsDog", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a dog as a dog", - "operation": { - "$id": "1181", - "name": "updateDogAsDog", - "isExactName": false, - "resourceName": "DogOperations", - "doc": "Update a dog as a dog", - "accessibility": "public", - "parameters": [ - { - "$id": "1182", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "262" - }, - "isApiVersion": false, - "optional": false, - "isContentType": true, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", - "methodParameterSegments": [ - { - "$id": "1183", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "262" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "List things with paging", + "operation": { + "$id": "983", + "name": "ListWithPaging", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "List things with paging", + "accessibility": "public", + "parameters": [ + { + "$id": "984", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "202" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", + "methodParameterSegments": [ { - "$id": "1184", - "kind": "header", + "$id": "985", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "264" + "$ref": "202" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", - "methodParameterSegments": [ - { - "$id": "1185", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "264" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, - { - "$id": "1186", - "kind": "body", - "name": "dog", - "serializedName": "dog", - "type": { - "$ref": "667" - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", - "methodParameterSegments": [ - { - "$id": "1187", - "kind": "method", - "name": "dog", - "serializedName": "dog", - "type": { - "$ref": "667" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "dog" - } - } } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "667" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/dogs/dog/as-dog", - "requestMediaTypes": [ + "bodyType": { + "$ref": "407" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ "application/json" ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1187" - }, - { - "$ref": "1183" - }, - { - "$ref": "1185" - } - ], - "response": { - "type": { - "$ref": "667" + "serializationOptions": { + "json": { + "name": "" + } } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog" - } - ], + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/list/paging", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1188", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1189", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.sampleTypeSpecUrl", - "isExactName": false + "$ref": "985" } ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "808" + "response": { + "type": { + "$ref": "394" + }, + "resultSegments": [ + "items" + ] }, - "isMultiServiceClient": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging", + "pagingMetadata": { + "itemPropertySegments": [ + "items" + ], + "pageSizeParameterSegments": [] + } }, { - "$id": "1190", - "kind": "client", - "name": "PlantOperations", + "$id": "986", + "kind": "basic", + "name": "EmbeddedParameters", "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1191", - "kind": "basic", - "name": "getTree", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Get a tree as a plant", - "operation": { - "$id": "1192", - "name": "getTree", - "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Get a tree as a plant", - "accessibility": "public", - "parameters": [ + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "An operation with embedded parameters within the body", + "operation": { + "$id": "987", + "name": "EmbeddedParameters", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "An operation with embedded parameters within the body", + "accessibility": "public", + "parameters": [ + { + "$id": "988", + "kind": "header", + "name": "requiredHeader", + "serializedName": "required-header", + "doc": "required header parameter", + "type": { + "$id": "989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", + "methodParameterSegments": [ { - "$id": "1193", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "990", + "kind": "method", + "name": "body", + "serializedName": "body", "type": { - "$ref": "266" + "$ref": "409" }, + "location": "Body", "isApiVersion": false, "optional": false, - "isContentType": false, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", - "methodParameterSegments": [ - { - "$id": "1194", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "266" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - } - ], - "responses": [ + }, { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "671" + "$id": "991", + "kind": "method", + "name": "requiredHeader", + "serializedName": "requiredHeader", + "doc": "required header parameter", + "type": { + "$ref": "413" }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "268" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/xml" - ], - "serializationOptions": { - "xml": { - "name": "" - } - } + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false } ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree", - "decorators": [], - "namespace": "SampleTypeSpec" + "isExactName": false }, - "parameters": [ - { - "$ref": "1194" - } - ], - "response": { + { + "$id": "992", + "kind": "header", + "name": "optionalHeader", + "serializedName": "optional-header", + "doc": "optional header parameter", "type": { - "$ref": "671" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" - }, - { - "$id": "1195", - "kind": "basic", - "name": "getTreeAsJson", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Get a tree as a plant", - "operation": { - "$id": "1196", - "name": "getTreeAsJson", - "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Get a tree as a plant", - "accessibility": "public", - "parameters": [ + "$id": "993", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": true, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", + "methodParameterSegments": [ { - "$id": "1197", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$ref": "990" + }, + { + "$id": "994", + "kind": "method", + "name": "optionalHeader", + "serializedName": "optionalHeader", + "doc": "optional header parameter", "type": { - "$ref": "270" + "$ref": "415" }, + "location": "", "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", - "methodParameterSegments": [ - { - "$id": "1198", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "270" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "671" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "272" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant/json", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson", - "decorators": [], - "namespace": "SampleTypeSpec" + "isExactName": false }, - "parameters": [ - { - "$ref": "1198" - } - ], - "response": { + { + "$id": "995", + "kind": "query", + "name": "requiredQuery", + "serializedName": "requiredQuery", + "doc": "required query parameter", "type": { - "$ref": "671" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" - }, - { - "$id": "1199", - "kind": "basic", - "name": "updateTree", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a tree as a plant", - "operation": { - "$id": "1200", - "name": "updateTree", - "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Update a tree as a plant", - "accessibility": "public", - "parameters": [ + "$id": "996", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", + "readOnly": false, + "methodParameterSegments": [ { - "$id": "1201", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", + "$ref": "990" + }, + { + "$id": "997", + "kind": "method", + "name": "requiredQuery", + "serializedName": "requiredQuery", + "doc": "required query parameter", "type": { - "$ref": "274" + "$ref": "417" }, + "location": "", "isApiVersion": false, "optional": false, - "isContentType": true, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredQuery", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", - "methodParameterSegments": [ - { - "$id": "1202", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "274" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "998", + "kind": "query", + "name": "optionalQuery", + "serializedName": "optionalQuery", + "doc": "optional query parameter", + "type": { + "$id": "999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "990" }, { - "$id": "1203", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1000", + "kind": "method", + "name": "optionalQuery", + "serializedName": "optionalQuery", + "doc": "optional query parameter", "type": { - "$ref": "278" + "$ref": "419" }, + "location": "", "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalQuery", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", - "methodParameterSegments": [ - { - "$id": "1204", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "278" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "1001", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "204" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", + "methodParameterSegments": [ { - "$id": "1205", - "kind": "body", - "name": "tree", - "serializedName": "tree", + "$id": "1002", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "671" + "$ref": "204" }, + "location": "Header", "isApiVersion": false, - "contentTypes": [ - "application/xml" - ], - "defaultContentType": "application/xml", "optional": false, - "scope": "Method", - "decorators": [], + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", - "methodParameterSegments": [ - { - "$id": "1206", - "kind": "method", - "name": "tree", - "serializedName": "tree", - "type": { - "$ref": "671" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "xml": { - "name": "tree" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "responses": [ + "isExactName": false + }, + { + "$id": "1003", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "409" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", + "methodParameterSegments": [ { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "671" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "280" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/xml" - ], - "serializationOptions": { - "xml": { - "name": "" - } - } + "$ref": "990" } ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant", - "requestMediaTypes": [ - "application/xml" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1206" - }, - { - "$ref": "1202" - }, - { - "$ref": "1204" - } - ], - "response": { - "type": { - "$ref": "671" + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/embeddedParameters", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "990" }, { - "$id": "1207", - "kind": "basic", - "name": "updateTreeAsJson", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Update a tree as a plant", - "operation": { - "$id": "1208", - "name": "updateTreeAsJson", - "isExactName": false, - "resourceName": "PlantOperations", - "doc": "Update a tree as a plant", - "accessibility": "public", - "parameters": [ + "$ref": "1002" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" + }, + { + "$id": "1004", + "kind": "basic", + "name": "DynamicModelOperation", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "An operation with a dynamic model", + "operation": { + "$id": "1005", + "name": "DynamicModelOperation", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "An operation with a dynamic model", + "accessibility": "public", + "parameters": [ + { + "$id": "1006", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "206" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", + "methodParameterSegments": [ { - "$id": "1209", - "kind": "header", + "$id": "1007", + "kind": "method", "name": "contentType", "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "282" + "$ref": "206" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": true, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", - "methodParameterSegments": [ - { - "$id": "1210", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "type": { - "$ref": "282" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "1008", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "420" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", + "methodParameterSegments": [ { - "$id": "1211", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1009", + "kind": "method", + "name": "body", + "serializedName": "body", "type": { - "$ref": "286" + "$ref": "420" }, + "location": "Body", "isApiVersion": false, "optional": false, - "isContentType": false, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", - "methodParameterSegments": [ - { - "$id": "1212", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "286" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/dynamicModel", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation", + "decorators": [], + "namespace": "SampleTypeSpec", + "experimental": { + "diagnosticId": "SAMPLE0002", + "dependsOn": [ + "SCME0001" + ] + } + }, + "parameters": [ + { + "$ref": "1009" + }, + { + "$ref": "1007" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" + }, + { + "$id": "1010", + "kind": "basic", + "name": "GetXmlAdvancedModel", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Get an advanced XML model with various property types", + "operation": { + "$id": "1011", + "name": "GetXmlAdvancedModel", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Get an advanced XML model with various property types", + "accessibility": "public", + "parameters": [ + { + "$id": "1012", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "208" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", + "methodParameterSegments": [ { - "$id": "1213", - "kind": "body", - "name": "tree", - "serializedName": "tree", + "$id": "1013", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "671" + "$ref": "208" }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", + "location": "Header", + "isApiVersion": false, "optional": false, - "scope": "Method", - "decorators": [], + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", - "methodParameterSegments": [ - { - "$id": "1214", - "kind": "method", - "name": "tree", - "serializedName": "tree", - "type": { - "$ref": "671" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "tree" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "responses": [ + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "458" + }, + "headers": [ { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "671" - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "288" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "210" } } ], - "httpMethod": "PUT", - "uri": "{sampleTypeSpecUrl}", - "path": "/plants/tree/as-plant/json", - "requestMediaTypes": [ - "application/json" + "isErrorResponse": false, + "contentTypes": [ + "application/xml" ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1214" - }, - { - "$ref": "1210" - }, - { - "$ref": "1212" - } - ], - "response": { - "type": { - "$ref": "671" + "serializationOptions": { + "xml": { + "name": "" + } } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson" - } - ], + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/xmlAdvanced", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1215", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1216", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.sampleTypeSpecUrl", - "isExactName": false + "$ref": "1013" } ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "808" + "response": { + "type": { + "$ref": "458" + } }, - "isMultiServiceClient": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" }, { - "$id": "1217", - "kind": "client", - "name": "Metrics", + "$id": "1014", + "kind": "basic", + "name": "UpdateXmlAdvancedModel", "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1218", - "kind": "basic", - "name": "getWidgetMetrics", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Get Widget metrics for given day of week", - "operation": { - "$id": "1219", - "name": "getWidgetMetrics", - "isExactName": false, - "resourceName": "Metrics", - "doc": "Get Widget metrics for given day of week", - "accessibility": "public", - "parameters": [ - { - "$id": "1220", - "kind": "path", - "name": "metricsNamespace", - "serializedName": "metricsNamespace", - "type": { - "$id": "1221", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", - "methodParameterSegments": [ - { - "$id": "1222", - "kind": "method", - "name": "metricsNamespace", - "serializedName": "metricsNamespace", - "type": { - "$id": "1223", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - }, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Update an advanced XML model with various property types", + "operation": { + "$id": "1015", + "name": "UpdateXmlAdvancedModel", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Update an advanced XML model with various property types", + "accessibility": "public", + "parameters": [ + { + "$id": "1016", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "212" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", + "methodParameterSegments": [ { - "$id": "1224", - "kind": "path", - "name": "day", - "serializedName": "day", + "$id": "1017", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", "type": { - "$ref": "87" + "$ref": "212" }, + "location": "Header", "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, "optional": false, - "scope": "Method", - "decorators": [], + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", - "methodParameterSegments": [ - { - "$id": "1225", - "kind": "method", - "name": "day", - "serializedName": "day", - "type": { - "$ref": "87" - }, - "location": "Path", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], + "access": "public", + "decorators": [], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "1018", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "216" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", + "methodParameterSegments": [ { - "$id": "1226", - "kind": "header", + "$id": "1019", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "290" + "$ref": "216" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", - "methodParameterSegments": [ - { - "$id": "1227", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "290" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ + "isExactName": false + }, + { + "$id": "1020", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "458" + }, + "isApiVersion": false, + "contentTypes": [ + "application/xml" + ], + "defaultContentType": "application/xml", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", + "methodParameterSegments": [ { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "687" + "$id": "1021", + "kind": "method", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "458" }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false } ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1225" - }, - { - "$ref": "1227" + "isExactName": false, + "serializationOptions": { + "xml": { + "name": "body" + } } - ], - "response": { - "type": { - "$ref": "687" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "458" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "218" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/xml" + ], + "serializationOptions": { + "xml": { + "name": "" + } } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics" - } - ], + } + ], + "httpMethod": "PUT", + "uri": "{sampleTypeSpecUrl}", + "path": "/xmlAdvanced", + "requestMediaTypes": [ + "application/xml" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1228", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1229", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl", - "isExactName": false + "$ref": "1021" + }, + { + "$ref": "1017" }, { - "$ref": "1222" + "$ref": "1019" } ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "808" + "response": { + "type": { + "$ref": "458" + } }, - "isMultiServiceClient": false + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" }, - { - "$id": "1230", - "kind": "client", - "name": "Notebooks", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1231", - "kind": "basic", - "name": "getNotebook", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "Get a notebook by name", - "operation": { - "$id": "1232", - "name": "getNotebook", - "isExactName": false, - "resourceName": "Notebooks", - "doc": "Get a notebook by name", - "accessibility": "public", - "parameters": [ + { + "$id": "1022", + "kind": "basic", + "name": "uploadCat", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1023", + "name": "uploadCat", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1024", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "220" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", + "methodParameterSegments": [ { - "$id": "1233", - "kind": "path", - "name": "notebookName", - "serializedName": "notebookName", + "$id": "1025", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", "type": { - "$id": "1234", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] + "$ref": "220" }, + "location": "Header", "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, "optional": false, - "scope": "Client", - "decorators": [], + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", - "methodParameterSegments": [ - { - "$id": "1235", - "kind": "method", - "name": "notebook", - "serializedName": "notebook", - "type": { - "$id": "1236", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.NotebookClientParams.notebook", - "readOnly": false, - "access": "public", - "decorators": [], - "paramAlias": "notebookName", - "isExactName": false - } - ], + "access": "public", + "decorators": [], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "1026", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$ref": "554" + }, + "isApiVersion": false, + "contentTypes": [ + "multipart/form-data" + ], + "defaultContentType": "multipart/form-data", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", + "methodParameterSegments": [ { - "$id": "1237", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1027", + "kind": "method", + "name": "body", + "serializedName": "body", "type": { - "$ref": "292" + "$ref": "554" }, + "location": "Body", "isApiVersion": false, "optional": false, - "isContentType": false, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", - "methodParameterSegments": [ - { - "$id": "1238", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "292" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "692" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } + "isExactName": false, + "serializationOptions": {} + } + ], + "responses": [ + { + "statusCodes": [ + 204 ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/notebooks/{notebookName}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1238" - } - ], - "response": { - "type": { - "$ref": "692" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook" - } - ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/cats", + "requestMediaTypes": [ + "multipart/form-data" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1239", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1240", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.sampleTypeSpecUrl", - "isExactName": false + "$ref": "1025" }, { - "$ref": "1235" + "$ref": "1027" } ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks", + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" + }, + { + "$id": "1028", + "kind": "basic", + "name": "sendJsonLines", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "parent": { - "$ref": "808" - }, - "isMultiServiceClient": false - }, - { - "$id": "1241", - "kind": "client", - "name": "Int16Collections", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1242", - "kind": "basic", - "name": "sendNested", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1243", - "name": "sendNested", - "isExactName": false, - "resourceName": "Int16Collections", - "accessibility": "public", - "parameters": [ + "operation": { + "$id": "1029", + "name": "sendJsonLines", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1030", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "type": { + "$ref": "224" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", + "methodParameterSegments": [ { - "$id": "1244", - "kind": "header", + "$id": "1031", + "kind": "method", + "name": "stream", + "serializedName": "stream", + "type": { + "$id": "1032", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "599" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines.stream", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + }, + { + "$id": "1033", + "kind": "method", "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "serializedName": "contentType", "type": { - "$ref": "294" + "$ref": "226" }, + "location": "", "isApiVersion": false, "optional": false, - "isContentType": true, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.contentType", - "methodParameterSegments": [ - { - "$id": "1245", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "294" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1034", + "kind": "body", + "name": "body", + "serializedName": "body", + "type": { + "$id": "1035", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "599" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + }, + "isApiVersion": false, + "contentTypes": [ + "application/jsonl" + ], + "defaultContentType": "application/jsonl", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", + "methodParameterSegments": [ + { + "$ref": "1031" }, { - "$id": "1246", - "kind": "body", + "$id": "1036", + "kind": "method", "name": "body", "serializedName": "body", "type": { - "$id": "1247", - "kind": "array", - "name": "ArrayArray2", - "valueType": { - "$id": "1248", - "kind": "array", - "name": "Array2", - "valueType": { - "$id": "1249", - "kind": "int16", - "name": "int16", - "crossLanguageDefinitionId": "TypeSpec.int16", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "$ref": "759" }, + "location": "", "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", "optional": false, "scope": "Method", - "decorators": [], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.body", - "methodParameterSegments": [ - { - "$id": "1250", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "1247" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } + "access": "public", + "decorators": [], + "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} + "isExactName": false, + "serializationOptions": { + "json": { + "name": "body" } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/int16-collections/nested-array", - "requestMediaTypes": [ - "application/json" - ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1250" - }, - { - "$ref": "1245" } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendNested" - }, + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/streaming/jsonl/send", + "requestMediaTypes": [ + "application/jsonl" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ { - "$id": "1251", - "kind": "basic", - "name": "sendRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1252", - "name": "sendRecord", - "isExactName": false, - "resourceName": "Int16Collections", - "accessibility": "public", - "parameters": [ + "$ref": "1031" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" + }, + { + "$id": "1037", + "kind": "basic", + "name": "receiveJsonLines", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1038", + "name": "receiveJsonLines", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1039", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "228" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", + "methodParameterSegments": [ { - "$id": "1253", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "1040", + "kind": "method", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "296" + "$ref": "228" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": true, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.contentType", - "methodParameterSegments": [ - { - "$id": "1254", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "296" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1041", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "599" }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + }, + "headers": [ { - "$id": "1255", - "kind": "body", - "name": "body", - "serializedName": "body", + "name": "contentType", + "nameInResponse": "content-type", "type": { - "$id": "1256", - "kind": "dict", - "keyType": { - "$id": "1257", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "1248" - }, - "decorators": [] - }, - "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.body", - "methodParameterSegments": [ - { - "$id": "1258", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "1256" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } + "$ref": "230" } } ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/int16-collections/record-of-arrays", - "requestMediaTypes": [ - "application/json" + "isErrorResponse": false, + "contentTypes": [ + "application/jsonl" ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1258" - }, - { - "$ref": "1254" + "serializationOptions": { + "json": { + "name": "" + } } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sendRecord" - }, + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/streaming/jsonl/receive", + "bufferResponse": false, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ { - "$id": "1259", - "kind": "basic", - "name": "getArray", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" + "$ref": "1040" + } + ], + "response": { + "type": { + "$id": "1042", + "kind": "streaming", + "name": "JsonlStreamStreamingItem", + "valueType": { + "$ref": "599" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" ], - "operation": { - "$id": "1260", - "name": "getArray", - "isExactName": false, - "resourceName": "Int16Collections", - "accessibility": "public", - "parameters": [ + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" + }, + { + "$id": "1043", + "kind": "basic", + "name": "receiveSse", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1044", + "name": "receiveSse", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1045", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "232" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", + "methodParameterSegments": [ { - "$id": "1261", - "kind": "header", + "$id": "1046", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "298" + "$ref": "232" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray.accept", - "methodParameterSegments": [ - { - "$id": "1262", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "298" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "1248" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1047", + "kind": "streaming", + "name": "SSEStreamSampleEvents", + "valueType": { + "$id": "1048", + "kind": "union", + "name": "SampleEvents", + "variantTypes": [ + { + "$ref": "599" + }, + { + "$ref": "234" } + ], + "namespace": "SampleTypeSpec", + "decorators": [], + "isExactName": false + }, + "streamKind": "sse", + "contentTypes": [ + "text/event-stream" + ], + "terminalEventValue": "[DONE]", + "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "236" } } ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/int16-collections/array", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray", - "decorators": [], - "namespace": "SampleTypeSpec" + "isErrorResponse": false, + "contentTypes": [ + "text/event-stream" + ], + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/streaming/sse/receive", + "bufferResponse": false, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1046" + } + ], + "response": { + "type": { + "$id": "1049", + "kind": "streaming", + "name": "SSEStreamSampleEvents", + "valueType": { + "$ref": "1048" }, - "parameters": [ - { - "$ref": "1262" - } + "streamKind": "sse", + "contentTypes": [ + "text/event-stream" ], - "response": { + "terminalEventValue": "[DONE]", + "crossLanguageDefinitionId": "TypeSpec.SSE.SSEStream" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" + }, + { + "$id": "1050", + "kind": "basic", + "name": "receiveExperimentalJsonLines", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "operation": { + "$id": "1051", + "name": "receiveExperimentalJsonLines", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "accessibility": "public", + "parameters": [ + { + "$id": "1052", + "kind": "header", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "1248" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getArray" - }, - { - "$id": "1263", - "kind": "basic", - "name": "getRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1264", - "name": "getRecord", - "isExactName": false, - "resourceName": "Int16Collections", - "accessibility": "public", - "parameters": [ + "$ref": "238" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", + "methodParameterSegments": [ { - "$id": "1265", - "kind": "header", + "$id": "1053", + "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "300" + "$ref": "238" }, + "location": "Header", "isApiVersion": false, "optional": false, - "isContentType": false, "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines.accept", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord.accept", - "methodParameterSegments": [ - { - "$id": "1266", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "300" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "1054", + "kind": "streaming", + "name": "JsonlStreamPreviewDetails", + "valueType": { + "$ref": "602" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" + ], + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + }, + "headers": [ { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1267", - "kind": "dict", - "keyType": { - "$id": "1268", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1269", - "kind": "int16", - "name": "int16", - "crossLanguageDefinitionId": "TypeSpec.int16", - "decorators": [] - }, - "decorators": [] - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "240" } } ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/int16-collections/record", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1266" + "isErrorResponse": false, + "contentTypes": [ + "application/jsonl" + ], + "serializationOptions": { + "json": { + "name": "" + } } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/experimental/jsonl", + "bufferResponse": false, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1053" + } + ], + "response": { + "type": { + "$id": "1055", + "kind": "streaming", + "name": "JsonlStreamPreviewDetails", + "valueType": { + "$ref": "602" + }, + "streamKind": "jsonl", + "contentTypes": [ + "application/jsonl" ], - "response": { + "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.receiveExperimentalJsonLines" + }, + { + "$id": "1056", + "kind": "basic", + "name": "getAcronymParameters", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "Send acronym-named path, query, and header parameters.", + "operation": { + "$id": "1057", + "name": "getAcronymParameters", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Send acronym-named path, query, and header parameters.", + "accessibility": "public", + "parameters": [ + { + "$id": "1058", + "kind": "path", + "name": "targetDbName", + "serializedName": "targetDbName", "type": { - "$ref": "1267" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getRecord" - }, - { - "$id": "1270", - "kind": "basic", - "name": "getNullableArray", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1271", - "name": "getNullableArray", - "isExactName": false, - "resourceName": "Int16Collections", - "accessibility": "public", - "parameters": [ + "$id": "1059", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", + "methodParameterSegments": [ { - "$id": "1272", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1060", + "kind": "method", + "name": "targetDbName", + "serializedName": "targetDbName", "type": { - "$ref": "302" + "$id": "1061", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Path", "isApiVersion": false, "optional": false, - "isContentType": false, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.targetDbName", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray.accept", - "methodParameterSegments": [ - { - "$id": "1273", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "302" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1274", - "kind": "array", - "name": "Array3", - "valueType": { - "$id": "1275", - "kind": "nullable", - "type": { - "$id": "1276", - "kind": "int16", - "name": "int16", - "crossLanguageDefinitionId": "TypeSpec.int16", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/int16-collections/nullable-array", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray", - "decorators": [], - "namespace": "SampleTypeSpec" + "isExactName": false }, - "parameters": [ - { - "$ref": "1273" - } - ], - "response": { + { + "$id": "1062", + "kind": "query", + "name": "sourceIpAddress", + "serializedName": "sourceIpAddress", "type": { - "$ref": "1274" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableArray" - }, - { - "$id": "1277", - "kind": "basic", - "name": "getNullableRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1278", - "name": "getNullableRecord", - "isExactName": false, - "resourceName": "Int16Collections", - "accessibility": "public", - "parameters": [ + "$id": "1063", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", + "readOnly": false, + "methodParameterSegments": [ { - "$id": "1279", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1064", + "kind": "method", + "name": "sourceIpAddress", + "serializedName": "sourceIpAddress", "type": { - "$ref": "304" + "$id": "1065", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Query", "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.sourceIpAddress", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord.accept", - "methodParameterSegments": [ - { - "$id": "1280", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "304" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false } ], - "responses": [ + "isExactName": false + }, + { + "$id": "1066", + "kind": "header", + "name": "guestOsType", + "serializedName": "X-Guest-OS-Type", + "type": { + "$id": "1067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": true, + "isContentType": false, + "scope": "Method", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", + "methodParameterSegments": [ { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1281", - "kind": "dict", - "keyType": { - "$id": "1282", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1283", - "kind": "nullable", - "type": { - "$id": "1284", - "kind": "int16", - "name": "int16", - "crossLanguageDefinitionId": "TypeSpec.int16", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, + "$id": "1068", + "kind": "method", + "name": "guestOsType", + "serializedName": "X-Guest-OS-Type", + "type": { + "$id": "1069", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/int16-collections/nullable-record", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1280" - } - ], - "response": { - "type": { - "$ref": "1281" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.getNullableRecord" - } - ], + "location": "Header", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters.guestOsType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/acronyms/{targetDbName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters", + "decorators": [], + "namespace": "SampleTypeSpec" + }, "parameters": [ { - "$id": "1285", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1286", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections.sampleTypeSpecUrl", - "isExactName": false + "$ref": "1060" + }, + { + "$ref": "1064" + }, + { + "$ref": "1068" } ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.Int16Collections", + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getAcronymParameters" + }, + { + "$id": "1070", + "kind": "basic", + "name": "setAcronymAddresses", + "isExactName": false, + "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], - "parent": { - "$ref": "808" - }, - "isMultiServiceClient": false - }, - { - "$id": "1287", - "kind": "client", - "name": "UInt16Collections", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ - { - "$id": "1288", - "kind": "basic", - "name": "sendNested", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1289", - "name": "sendNested", - "isExactName": false, - "resourceName": "UInt16Collections", - "accessibility": "public", - "parameters": [ + "doc": "Send parameters with leading IP version acronyms.", + "operation": { + "$id": "1071", + "name": "setAcronymAddresses", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "Send parameters with leading IP version acronyms.", + "accessibility": "public", + "parameters": [ + { + "$id": "1072", + "kind": "query", + "name": "ipV4Address", + "serializedName": "ipV4Address", + "type": { + "$id": "1073", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", + "readOnly": false, + "methodParameterSegments": [ { - "$id": "1290", - "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "$id": "1074", + "kind": "method", + "name": "ipV4Address", + "serializedName": "ipV4Address", "type": { - "$ref": "306" + "$id": "1075", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, + "location": "Query", "isApiVersion": false, "optional": false, - "isContentType": true, - "scope": "Constant", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV4Address", "readOnly": false, + "access": "public", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.contentType", - "methodParameterSegments": [ - { - "$id": "1291", - "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", - "type": { - "$ref": "306" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.contentType", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], "isExactName": false - }, + } + ], + "isExactName": false + }, + { + "$id": "1076", + "kind": "query", + "name": "ipV6Address", + "serializedName": "ipV6Address", + "type": { + "$id": "1077", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", + "readOnly": false, + "methodParameterSegments": [ { - "$id": "1292", - "kind": "body", - "name": "body", - "serializedName": "body", + "$id": "1078", + "kind": "method", + "name": "ipV6Address", + "serializedName": "ipV6Address", "type": { - "$id": "1293", - "kind": "array", - "name": "ArrayArray3", - "valueType": { - "$id": "1294", - "kind": "array", - "name": "Array4", - "valueType": { - "$id": "1295", - "kind": "uint16", - "name": "uint16", - "crossLanguageDefinitionId": "TypeSpec.uint16", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "1079", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, + "location": "Query", "isApiVersion": false, - "contentTypes": [ - "application/json" - ], - "defaultContentType": "application/json", - "optional": false, + "optional": true, "scope": "Method", - "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses.ipV6Address", "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.body", - "methodParameterSegments": [ - { - "$id": "1296", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "1293" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, - "serializationOptions": { - "json": { - "name": "body" - } - } - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} + "access": "public", + "decorators": [], + "isExactName": false } ], - "httpMethod": "POST", - "uri": "{sampleTypeSpecUrl}", - "path": "/uint16-collections/nested-array", - "requestMediaTypes": [ - "application/json" + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 ], - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1296" - }, - { - "$ref": "1291" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendNested" + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "POST", + "uri": "{sampleTypeSpecUrl}", + "path": "/acronyms/addresses", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "1074" }, { - "$id": "1297", + "$ref": "1078" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.setAcronymAddresses" + } + ], + "parameters": [ + { + "$id": "1080", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1081", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.sampleTypeSpecUrl", + "isExactName": false + }, + { + "$ref": "954" + } + ], + "initializedBy": 1, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "children": [ + { + "$id": "1082", + "kind": "client", + "name": "ExperimentalSamples", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1083", "kind": "basic", - "name": "sendRecord", + "name": "read", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -20957,43 +17127,41 @@ "2024-08-16-preview" ], "operation": { - "$id": "1298", - "name": "sendRecord", + "$id": "1084", + "name": "read", "isExactName": false, - "resourceName": "UInt16Collections", + "resourceName": "ExperimentalSamples", "accessibility": "public", "parameters": [ { - "$id": "1299", + "$id": "1085", "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "308" + "$ref": "242" }, "isApiVersion": false, "optional": false, - "isContentType": true, + "isContentType": false, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", "methodParameterSegments": [ { - "$id": "1300", + "$id": "1086", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "308" + "$ref": "242" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read.accept", "readOnly": false, "access": "public", "decorators": [], @@ -21001,106 +17169,57 @@ } ], "isExactName": false - }, + } + ], + "responses": [ { - "$id": "1301", - "kind": "body", - "name": "body", - "serializedName": "body", - "type": { - "$id": "1302", - "kind": "dict", - "keyType": { - "$id": "1303", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "1294" - }, - "decorators": [] + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "604" }, - "isApiVersion": false, + "headers": [], + "isErrorResponse": false, "contentTypes": [ "application/json" ], - "defaultContentType": "application/json", - "optional": false, - "scope": "Method", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.body", - "methodParameterSegments": [ - { - "$id": "1304", - "kind": "method", - "name": "body", - "serializedName": "body", - "type": { - "$ref": "1302" - }, - "location": "Body", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord.body", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false, "serializationOptions": { "json": { - "name": "body" + "name": "" } } } ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false, - "serializationOptions": {} - } - ], - "httpMethod": "POST", + "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/uint16-collections/record-of-arrays", - "requestMediaTypes": [ - "application/json" - ], + "path": "/experimental", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1304" - }, - { - "$ref": "1300" + "$ref": "1086" } ], - "response": {}, + "response": { + "type": { + "$ref": "604" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sendRecord" + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.read" }, { - "$id": "1305", - "kind": "basic", - "name": "getArray", + "$id": "1087", + "kind": "paging", + "name": "list", "isExactName": false, "accessibility": "public", "apiVersions": [ @@ -21108,19 +17227,19 @@ "2024-08-16-preview" ], "operation": { - "$id": "1306", - "name": "getArray", + "$id": "1088", + "name": "list", "isExactName": false, - "resourceName": "UInt16Collections", + "resourceName": "ExperimentalSamples", "accessibility": "public", "parameters": [ { - "$id": "1307", + "$id": "1089", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "310" + "$ref": "244" }, "isApiVersion": false, "optional": false, @@ -21128,21 +17247,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", "methodParameterSegments": [ { - "$id": "1308", + "$id": "1090", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "310" + "$ref": "244" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list.accept", "readOnly": false, "access": "public", "decorators": [], @@ -21158,7 +17277,7 @@ 200 ], "bodyType": { - "$ref": "1294" + "$ref": "607" }, "headers": [], "isErrorResponse": false, @@ -21174,53 +17293,150 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/uint16-collections/array", + "path": "/experimental/pages", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray", + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1308" + "$ref": "1090" } ], "response": { "type": { - "$ref": "1294" - } + "$ref": "609" + }, + "resultSegments": [ + "items" + ] }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getArray" - }, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.list", + "pagingMetadata": { + "itemPropertySegments": [ + "items" + ], + "pageSizeParameterSegments": [] + } + } + ], + "parameters": [ + { + "$id": "1091", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1092", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples.sampleTypeSpecUrl", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.ExperimentalSamples", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "760" + }, + "isMultiServiceClient": false, + "experimental": { + "diagnosticId": "SAMPLE0009", + "dependsOn": [] + } + }, + { + "$id": "1093", + "kind": "client", + "name": "AnimalOperations", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ { - "$id": "1309", + "$id": "1094", "kind": "basic", - "name": "getRecord", + "name": "updatePetAsAnimal", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a pet as an animal", "operation": { - "$id": "1310", - "name": "getRecord", + "$id": "1095", + "name": "updatePetAsAnimal", "isExactName": false, - "resourceName": "UInt16Collections", + "resourceName": "AnimalOperations", + "doc": "Update a pet as an animal", "accessibility": "public", "parameters": [ { - "$id": "1311", + "$id": "1096", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "246" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", + "methodParameterSegments": [ + { + "$id": "1097", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "246" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1098", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "312" + "$ref": "248" }, "isApiVersion": false, "optional": false, @@ -21228,21 +17444,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "methodParameterSegments": [ { - "$id": "1312", + "$id": "1099", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "312" + "$ref": "248" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "readOnly": false, "access": "public", "decorators": [], @@ -21250,6 +17466,51 @@ } ], "isExactName": false + }, + { + "$id": "1100", + "kind": "body", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "610" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", + "methodParameterSegments": [ + { + "$id": "1101", + "kind": "method", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "610" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "animal" + } + } } ], "responses": [ @@ -21258,23 +17519,7 @@ 200 ], "bodyType": { - "$id": "1313", - "kind": "dict", - "keyType": { - "$id": "1314", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1315", - "kind": "uint16", - "name": "uint16", - "crossLanguageDefinitionId": "TypeSpec.uint16", - "decorators": [] - }, - "decorators": [] + "$ref": "610" }, "headers": [], "isErrorResponse": false, @@ -21288,77 +17533,90 @@ } } ], - "httpMethod": "GET", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint16-collections/record", + "path": "/animals/pet/as-animal", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1312" + "$ref": "1101" + }, + { + "$ref": "1097" + }, + { + "$ref": "1099" } ], "response": { "type": { - "$ref": "1313" + "$ref": "610" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getRecord" + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" }, { - "$id": "1316", + "$id": "1102", "kind": "basic", - "name": "getNullableArray", + "name": "updateDogAsAnimal", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a dog as an animal", "operation": { - "$id": "1317", - "name": "getNullableArray", + "$id": "1103", + "name": "updateDogAsAnimal", "isExactName": false, - "resourceName": "UInt16Collections", + "resourceName": "AnimalOperations", + "doc": "Update a dog as an animal", "accessibility": "public", "parameters": [ { - "$id": "1318", + "$id": "1104", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "314" + "$ref": "250" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "1319", + "$id": "1105", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "314" + "$ref": "250" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -21366,93 +17624,14 @@ } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1320", - "kind": "array", - "name": "Array5", - "valueType": { - "$id": "1321", - "kind": "nullable", - "type": { - "$id": "1322", - "kind": "uint16", - "name": "uint16", - "crossLanguageDefinitionId": "TypeSpec.uint16", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/uint16-collections/nullable-array", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1319" - } - ], - "response": { - "type": { - "$ref": "1320" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableArray" - }, - { - "$id": "1323", - "kind": "basic", - "name": "getNullableRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1324", - "name": "getNullableRecord", - "isExactName": false, - "resourceName": "UInt16Collections", - "accessibility": "public", - "parameters": [ + }, { - "$id": "1325", + "$id": "1106", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "316" + "$ref": "252" }, "isApiVersion": false, "optional": false, @@ -21460,21 +17639,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "methodParameterSegments": [ { - "$id": "1326", + "$id": "1107", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "316" + "$ref": "252" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "readOnly": false, "access": "public", "decorators": [], @@ -21482,6 +17661,51 @@ } ], "isExactName": false + }, + { + "$id": "1108", + "kind": "body", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "610" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", + "methodParameterSegments": [ + { + "$id": "1109", + "kind": "method", + "name": "animal", + "serializedName": "animal", + "type": { + "$ref": "610" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "animal" + } + } } ], "responses": [ @@ -21490,28 +17714,7 @@ 200 ], "bodyType": { - "$id": "1327", - "kind": "dict", - "keyType": { - "$id": "1328", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1329", - "kind": "nullable", - "type": { - "$id": "1330", - "kind": "uint16", - "name": "uint16", - "crossLanguageDefinitionId": "TypeSpec.uint16", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] + "$ref": "610" }, "headers": [], "isErrorResponse": false, @@ -21525,40 +17728,49 @@ } } ], - "httpMethod": "GET", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint16-collections/nullable-record", + "path": "/animals/dog/as-animal", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1326" + "$ref": "1109" + }, + { + "$ref": "1105" + }, + { + "$ref": "1107" } ], "response": { "type": { - "$ref": "1327" + "$ref": "610" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.getNullableRecord" + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal" } ], "parameters": [ { - "$id": "1331", + "$id": "1110", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1332", + "$id": "1111", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -21570,77 +17782,116 @@ "serverUrlTemplate": "{sampleTypeSpecUrl}", "skipUrlEncoding": false, "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections.sampleTypeSpecUrl", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.sampleTypeSpecUrl", "isExactName": false } ], "initializedBy": 0, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt16Collections", + "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "parent": { - "$ref": "808" + "$ref": "760" }, "isMultiServiceClient": false }, { - "$id": "1333", + "$id": "1112", "kind": "client", - "name": "UInt32Collections", + "name": "PetOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1334", + "$id": "1113", "kind": "basic", - "name": "sendNested", + "name": "updatePetAsPet", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a pet as a pet", "operation": { - "$id": "1335", - "name": "sendNested", + "$id": "1114", + "name": "updatePetAsPet", "isExactName": false, - "resourceName": "UInt32Collections", + "resourceName": "PetOperations", + "doc": "Update a pet as a pet", "accessibility": "public", "parameters": [ { - "$id": "1336", + "$id": "1115", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "254" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", + "methodParameterSegments": [ + { + "$id": "1116", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "254" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1117", "kind": "header", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "318" + "$ref": "256" }, "isApiVersion": false, "optional": false, - "isContentType": true, + "isContentType": false, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "methodParameterSegments": [ { - "$id": "1337", + "$id": "1118", "kind": "method", - "name": "contentType", - "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", + "name": "accept", + "serializedName": "Accept", "type": { - "$ref": "318" + "$ref": "256" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "readOnly": false, "access": "public", "decorators": [], @@ -21650,30 +17901,12 @@ "isExactName": false }, { - "$id": "1338", + "$id": "1119", "kind": "body", - "name": "body", - "serializedName": "body", + "name": "pet", + "serializedName": "pet", "type": { - "$id": "1339", - "kind": "array", - "name": "ArrayArray4", - "valueType": { - "$id": "1340", - "kind": "array", - "name": "Array6", - "valueType": { - "$id": "1341", - "kind": "uint32", - "name": "uint32", - "crossLanguageDefinitionId": "TypeSpec.uint32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "$ref": "615" }, "isApiVersion": false, "contentTypes": [ @@ -21684,21 +17917,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "methodParameterSegments": [ { - "$id": "1342", + "$id": "1120", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "pet", + "serializedName": "pet", "type": { - "$ref": "1339" + "$ref": "615" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "readOnly": false, "access": "public", "decorators": [], @@ -21708,7 +17941,7 @@ "isExactName": false, "serializationOptions": { "json": { - "name": "body" + "name": "pet" } } } @@ -21716,65 +17949,84 @@ "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "615" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "POST", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint32-collections/nested-array", + "path": "/pets/pet/as-pet", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1342" + "$ref": "1120" + }, + { + "$ref": "1116" }, { - "$ref": "1337" + "$ref": "1118" } ], - "response": {}, + "response": { + "type": { + "$ref": "615" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendNested" + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" }, { - "$id": "1343", + "$id": "1121", "kind": "basic", - "name": "sendRecord", + "name": "updateDogAsPet", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a dog as a pet", "operation": { - "$id": "1344", - "name": "sendRecord", + "$id": "1122", + "name": "updateDogAsPet", "isExactName": false, - "resourceName": "UInt32Collections", + "resourceName": "PetOperations", + "doc": "Update a dog as a pet", "accessibility": "public", "parameters": [ { - "$id": "1345", + "$id": "1123", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "320" + "$ref": "258" }, "isApiVersion": false, "optional": false, @@ -21782,22 +18034,59 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", "methodParameterSegments": [ { - "$id": "1346", + "$id": "1124", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "320" + "$ref": "258" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1125", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "260" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", + "methodParameterSegments": [ + { + "$id": "1126", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "260" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", "readOnly": false, "access": "public", "decorators": [], @@ -21807,24 +18096,12 @@ "isExactName": false }, { - "$id": "1347", + "$id": "1127", "kind": "body", - "name": "body", - "serializedName": "body", + "name": "pet", + "serializedName": "pet", "type": { - "$id": "1348", - "kind": "dict", - "keyType": { - "$id": "1349", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "1340" - }, - "decorators": [] + "$ref": "615" }, "isApiVersion": false, "contentTypes": [ @@ -21835,21 +18112,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "methodParameterSegments": [ { - "$id": "1350", + "$id": "1128", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "pet", + "serializedName": "pet", "type": { - "$ref": "1348" + "$ref": "615" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "readOnly": false, "access": "public", "decorators": [], @@ -21859,7 +18136,7 @@ "isExactName": false, "serializationOptions": { "json": { - "name": "body" + "name": "pet" } } } @@ -21867,86 +18144,150 @@ "responses": [ { "statusCodes": [ - 204 + 200 ], + "bodyType": { + "$ref": "615" + }, "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "POST", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint32-collections/record-of-arrays", + "path": "/pets/dog/as-pet", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1350" + "$ref": "1128" + }, + { + "$ref": "1124" }, { - "$ref": "1346" + "$ref": "1126" } ], - "response": {}, + "response": { + "type": { + "$ref": "615" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sendRecord" - }, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet" + } + ], + "parameters": [ + { + "$id": "1129", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1130", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.sampleTypeSpecUrl", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "760" + }, + "isMultiServiceClient": false + }, + { + "$id": "1131", + "kind": "client", + "name": "DogOperations", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ { - "$id": "1351", + "$id": "1132", "kind": "basic", - "name": "getArray", + "name": "updateDogAsDog", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a dog as a dog", "operation": { - "$id": "1352", - "name": "getArray", + "$id": "1133", + "name": "updateDogAsDog", "isExactName": false, - "resourceName": "UInt32Collections", + "resourceName": "DogOperations", + "doc": "Update a dog as a dog", "accessibility": "public", "parameters": [ { - "$id": "1353", + "$id": "1134", "kind": "header", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "322" + "$ref": "262" }, "isApiVersion": false, "optional": false, - "isContentType": false, + "isContentType": true, "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "methodParameterSegments": [ { - "$id": "1354", + "$id": "1135", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "322" + "$ref": "262" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "readOnly": false, "access": "public", "decorators": [], @@ -21954,77 +18295,14 @@ } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "1340" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/uint32-collections/array", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1354" - } - ], - "response": { - "type": { - "$ref": "1340" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getArray" - }, - { - "$id": "1355", - "kind": "basic", - "name": "getRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1356", - "name": "getRecord", - "isExactName": false, - "resourceName": "UInt32Collections", - "accessibility": "public", - "parameters": [ + }, { - "$id": "1357", + "$id": "1136", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "324" + "$ref": "264" }, "isApiVersion": false, "optional": false, @@ -22032,21 +18310,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "methodParameterSegments": [ { - "$id": "1358", + "$id": "1137", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "324" + "$ref": "264" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "readOnly": false, "access": "public", "decorators": [], @@ -22054,6 +18332,51 @@ } ], "isExactName": false + }, + { + "$id": "1138", + "kind": "body", + "name": "dog", + "serializedName": "dog", + "type": { + "$ref": "619" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", + "methodParameterSegments": [ + { + "$id": "1139", + "kind": "method", + "name": "dog", + "serializedName": "dog", + "type": { + "$ref": "619" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "dog" + } + } } ], "responses": [ @@ -22062,23 +18385,7 @@ 200 ], "bodyType": { - "$id": "1359", - "kind": "dict", - "keyType": { - "$id": "1360", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1361", - "kind": "uint32", - "name": "uint32", - "crossLanguageDefinitionId": "TypeSpec.uint32", - "decorators": [] - }, - "decorators": [] + "$ref": "619" }, "headers": [], "isErrorResponse": false, @@ -22092,55 +18399,109 @@ } } ], - "httpMethod": "GET", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint32-collections/record", + "path": "/dogs/dog/as-dog", + "requestMediaTypes": [ + "application/json" + ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1358" + "$ref": "1139" + }, + { + "$ref": "1135" + }, + { + "$ref": "1137" } ], "response": { "type": { - "$ref": "1359" + "$ref": "619" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getRecord" - }, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog" + } + ], + "parameters": [ + { + "$id": "1140", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1141", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.sampleTypeSpecUrl", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "760" + }, + "isMultiServiceClient": false + }, + { + "$id": "1142", + "kind": "client", + "name": "PlantOperations", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ { - "$id": "1362", + "$id": "1143", "kind": "basic", - "name": "getNullableArray", + "name": "getTree", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Get a tree as a plant", "operation": { - "$id": "1363", - "name": "getNullableArray", + "$id": "1144", + "name": "getTree", "isExactName": false, - "resourceName": "UInt32Collections", + "resourceName": "PlantOperations", + "doc": "Get a tree as a plant", "accessibility": "public", "parameters": [ { - "$id": "1364", + "$id": "1145", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "326" + "$ref": "266" }, "isApiVersion": false, "optional": false, @@ -22148,21 +18509,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "methodParameterSegments": [ { - "$id": "1365", + "$id": "1146", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "326" + "$ref": "266" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "readOnly": false, "access": "public", "decorators": [], @@ -22178,31 +18539,23 @@ 200 ], "bodyType": { - "$id": "1366", - "kind": "array", - "name": "Array7", - "valueType": { - "$id": "1367", - "kind": "nullable", - "type": { - "$id": "1368", - "kind": "uint32", - "name": "uint32", - "crossLanguageDefinitionId": "TypeSpec.uint32", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "$ref": "623" }, - "headers": [], + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "268" + } + } + ], "isErrorResponse": false, "contentTypes": [ - "application/json" + "application/xml" ], "serializationOptions": { - "json": { + "xml": { "name": "" } } @@ -22210,53 +18563,55 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/uint32-collections/nullable-array", + "path": "/plants/tree/as-plant", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1365" + "$ref": "1146" } ], "response": { "type": { - "$ref": "1366" + "$ref": "623" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableArray" + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" }, { - "$id": "1369", + "$id": "1147", "kind": "basic", - "name": "getNullableRecord", + "name": "getTreeAsJson", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Get a tree as a plant", "operation": { - "$id": "1370", - "name": "getNullableRecord", + "$id": "1148", + "name": "getTreeAsJson", "isExactName": false, - "resourceName": "UInt32Collections", + "resourceName": "PlantOperations", + "doc": "Get a tree as a plant", "accessibility": "public", "parameters": [ { - "$id": "1371", + "$id": "1149", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "328" + "$ref": "270" }, "isApiVersion": false, "optional": false, @@ -22264,21 +18619,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1372", + "$id": "1150", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "328" + "$ref": "270" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "readOnly": false, "access": "public", "decorators": [], @@ -22294,30 +18649,17 @@ 200 ], "bodyType": { - "$id": "1373", - "kind": "dict", - "keyType": { - "$id": "1374", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1375", - "kind": "nullable", - "type": { - "$id": "1376", - "kind": "uint32", - "name": "uint32", - "crossLanguageDefinitionId": "TypeSpec.uint32", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] + "$ref": "623" }, - "headers": [], + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "272" + } + } + ], "isErrorResponse": false, "contentTypes": [ "application/json" @@ -22331,97 +18673,55 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/uint32-collections/nullable-record", + "path": "/plants/tree/as-plant/json", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1372" + "$ref": "1150" } ], "response": { "type": { - "$ref": "1373" + "$ref": "623" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.getNullableRecord" - } - ], - "parameters": [ - { - "$id": "1377", - "kind": "endpoint", - "name": "sampleTypeSpecUrl", - "serializedName": "sampleTypeSpecUrl", - "type": { - "$id": "1378", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "serverUrlTemplate": "{sampleTypeSpecUrl}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections.sampleTypeSpecUrl", - "isExactName": false - } - ], - "initializedBy": 0, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt32Collections", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "parent": { - "$ref": "808" - }, - "isMultiServiceClient": false - }, - { - "$id": "1379", - "kind": "client", - "name": "UInt64Collections", - "isExactName": false, - "namespace": "SampleTypeSpec", - "methods": [ + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" + }, { - "$id": "1380", + "$id": "1151", "kind": "basic", - "name": "sendNested", + "name": "updateTree", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a tree as a plant", "operation": { - "$id": "1381", - "name": "sendNested", + "$id": "1152", + "name": "updateTree", "isExactName": false, - "resourceName": "UInt64Collections", + "resourceName": "PlantOperations", + "doc": "Update a tree as a plant", "accessibility": "public", "parameters": [ { - "$id": "1382", + "$id": "1153", "kind": "header", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "330" + "$ref": "274" }, "isApiVersion": false, "optional": false, @@ -22429,22 +18729,58 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", "methodParameterSegments": [ { - "$id": "1383", + "$id": "1154", "kind": "method", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "330" + "$ref": "274" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1155", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "278" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", + "methodParameterSegments": [ + { + "$id": "1156", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "278" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", "readOnly": false, "access": "public", "decorators": [], @@ -22454,55 +18790,37 @@ "isExactName": false }, { - "$id": "1384", + "$id": "1157", "kind": "body", - "name": "body", - "serializedName": "body", + "name": "tree", + "serializedName": "tree", "type": { - "$id": "1385", - "kind": "array", - "name": "ArrayArray5", - "valueType": { - "$id": "1386", - "kind": "array", - "name": "Array8", - "valueType": { - "$id": "1387", - "kind": "uint64", - "name": "uint64", - "crossLanguageDefinitionId": "TypeSpec.uint64", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] + "$ref": "623" }, "isApiVersion": false, "contentTypes": [ - "application/json" + "application/xml" ], - "defaultContentType": "application/json", + "defaultContentType": "application/xml", "optional": false, "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "methodParameterSegments": [ { - "$id": "1388", + "$id": "1158", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "tree", + "serializedName": "tree", "type": { - "$ref": "1385" + "$ref": "623" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "readOnly": false, "access": "public", "decorators": [], @@ -22511,8 +18829,8 @@ ], "isExactName": false, "serializationOptions": { - "json": { - "name": "body" + "xml": { + "name": "tree" } } } @@ -22520,65 +18838,91 @@ "responses": [ { "statusCodes": [ - 204 + 200 + ], + "bodyType": { + "$ref": "623" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "280" + } + } ], - "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/xml" + ], + "serializationOptions": { + "xml": { + "name": "" + } + } } ], - "httpMethod": "POST", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint64-collections/nested-array", + "path": "/plants/tree/as-plant", "requestMediaTypes": [ - "application/json" + "application/xml" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1388" + "$ref": "1158" }, { - "$ref": "1383" + "$ref": "1154" + }, + { + "$ref": "1156" } ], - "response": {}, + "response": { + "type": { + "$ref": "623" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendNested" + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" }, { - "$id": "1389", + "$id": "1159", "kind": "basic", - "name": "sendRecord", + "name": "updateTreeAsJson", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Update a tree as a plant", "operation": { - "$id": "1390", - "name": "sendRecord", + "$id": "1160", + "name": "updateTreeAsJson", "isExactName": false, - "resourceName": "UInt64Collections", + "resourceName": "PlantOperations", + "doc": "Update a tree as a plant", "accessibility": "public", "parameters": [ { - "$id": "1391", + "$id": "1161", "kind": "header", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "332" + "$ref": "282" }, "isApiVersion": false, "optional": false, @@ -22586,22 +18930,58 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", "methodParameterSegments": [ { - "$id": "1392", + "$id": "1162", "kind": "method", "name": "contentType", "serializedName": "Content-Type", - "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "332" + "$ref": "282" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1163", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "286" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", + "methodParameterSegments": [ + { + "$id": "1164", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "286" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.contentType", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", "readOnly": false, "access": "public", "decorators": [], @@ -22611,24 +18991,12 @@ "isExactName": false }, { - "$id": "1393", + "$id": "1165", "kind": "body", - "name": "body", - "serializedName": "body", + "name": "tree", + "serializedName": "tree", "type": { - "$id": "1394", - "kind": "dict", - "keyType": { - "$id": "1395", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$ref": "1386" - }, - "decorators": [] + "$ref": "623" }, "isApiVersion": false, "contentTypes": [ @@ -22639,21 +19007,21 @@ "scope": "Method", "decorators": [], "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "methodParameterSegments": [ { - "$id": "1396", + "$id": "1166", "kind": "method", - "name": "body", - "serializedName": "body", + "name": "tree", + "serializedName": "tree", "type": { - "$ref": "1394" + "$ref": "623" }, "location": "Body", "isApiVersion": false, "optional": false, "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord.body", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "readOnly": false, "access": "public", "decorators": [], @@ -22663,7 +19031,7 @@ "isExactName": false, "serializationOptions": { "json": { - "name": "body" + "name": "tree" } } } @@ -22671,86 +19039,207 @@ "responses": [ { "statusCodes": [ - 204 + 200 + ], + "bodyType": { + "$ref": "623" + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "288" + } + } ], - "headers": [], "isErrorResponse": false, - "serializationOptions": {} + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } } ], - "httpMethod": "POST", + "httpMethod": "PUT", "uri": "{sampleTypeSpecUrl}", - "path": "/uint64-collections/record-of-arrays", + "path": "/plants/tree/as-plant/json", "requestMediaTypes": [ "application/json" ], "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1396" + "$ref": "1166" + }, + { + "$ref": "1162" }, { - "$ref": "1392" + "$ref": "1164" } ], - "response": {}, + "response": { + "type": { + "$ref": "623" + } + }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sendRecord" - }, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson" + } + ], + "parameters": [ + { + "$id": "1167", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1168", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.sampleTypeSpecUrl", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "760" + }, + "isMultiServiceClient": false + }, + { + "$id": "1169", + "kind": "client", + "name": "Metrics", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ { - "$id": "1397", + "$id": "1170", "kind": "basic", - "name": "getArray", + "name": "getWidgetMetrics", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1398", - "name": "getArray", + "$id": "1171", + "name": "getWidgetMetrics", "isExactName": false, - "resourceName": "UInt64Collections", + "resourceName": "Metrics", + "doc": "Get Widget metrics for given day of week", "accessibility": "public", "parameters": [ { - "$id": "1399", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1172", + "kind": "path", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", "type": { - "$ref": "334" + "$id": "1173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "isContentType": false, - "scope": "Constant", + "scope": "Client", + "decorators": [], "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", + "methodParameterSegments": [ + { + "$id": "1174", + "kind": "method", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", + "type": { + "$id": "1175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "1176", + "kind": "path", + "name": "day", + "serializedName": "day", + "type": { + "$ref": "87" + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray.accept", + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "1400", + "$id": "1177", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "day", + "serializedName": "day", "type": { - "$ref": "334" + "$ref": "87" }, - "location": "Header", + "location": "Path", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray.accept", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "readOnly": false, "access": "public", "decorators": [], @@ -22758,77 +19247,14 @@ } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "1386" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/uint64-collections/array", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1400" - } - ], - "response": { - "type": { - "$ref": "1386" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getArray" - }, - { - "$id": "1401", - "kind": "basic", - "name": "getRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1402", - "name": "getRecord", - "isExactName": false, - "resourceName": "UInt64Collections", - "accessibility": "public", - "parameters": [ + }, { - "$id": "1403", + "$id": "1178", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "336" + "$ref": "290" }, "isApiVersion": false, "optional": false, @@ -22836,21 +19262,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "1404", + "$id": "1179", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "336" + "$ref": "290" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "readOnly": false, "access": "public", "decorators": [], @@ -22866,23 +19292,7 @@ 200 ], "bodyType": { - "$id": "1405", - "kind": "dict", - "keyType": { - "$id": "1406", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1407", - "kind": "uint64", - "name": "uint64", - "crossLanguageDefinitionId": "TypeSpec.uint64", - "decorators": [] - }, - "decorators": [] + "$ref": "639" }, "headers": [], "isErrorResponse": false, @@ -22898,169 +19308,153 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/uint64-collections/record", + "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1404" + "$ref": "1177" + }, + { + "$ref": "1179" } ], "response": { "type": { - "$ref": "1405" + "$ref": "639" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getRecord" + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics" + } + ], + "parameters": [ + { + "$id": "1180", + "kind": "endpoint", + "name": "sampleTypeSpecUrl", + "serializedName": "sampleTypeSpecUrl", + "type": { + "$id": "1181", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "serverUrlTemplate": "{sampleTypeSpecUrl}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl", + "isExactName": false }, { - "$id": "1408", + "$ref": "1174" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "parent": { + "$ref": "760" + }, + "isMultiServiceClient": false + }, + { + "$id": "1182", + "kind": "client", + "name": "Notebooks", + "isExactName": false, + "namespace": "SampleTypeSpec", + "methods": [ + { + "$id": "1183", "kind": "basic", - "name": "getNullableArray", + "name": "getNotebook", "isExactName": false, "accessibility": "public", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], + "doc": "Get a notebook by name", "operation": { - "$id": "1409", - "name": "getNullableArray", + "$id": "1184", + "name": "getNotebook", "isExactName": false, - "resourceName": "UInt64Collections", + "resourceName": "Notebooks", + "doc": "Get a notebook by name", "accessibility": "public", "parameters": [ { - "$id": "1410", - "kind": "header", - "name": "accept", - "serializedName": "Accept", + "$id": "1185", + "kind": "path", + "name": "notebookName", + "serializedName": "notebookName", "type": { - "$ref": "338" + "$id": "1186", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, + "scope": "Client", "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray.accept", + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", "methodParameterSegments": [ { - "$id": "1411", + "$id": "1187", "kind": "method", - "name": "accept", - "serializedName": "Accept", + "name": "notebook", + "serializedName": "notebook", "type": { - "$ref": "338" + "$id": "1188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] }, - "location": "Header", + "location": "", "isApiVersion": false, "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray.accept", + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.NotebookClientParams.notebook", "readOnly": false, "access": "public", "decorators": [], + "paramAlias": "notebookName", "isExactName": false } ], "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "1412", - "kind": "array", - "name": "Array9", - "valueType": { - "$id": "1413", - "kind": "nullable", - "type": { - "$id": "1414", - "kind": "uint64", - "name": "uint64", - "crossLanguageDefinitionId": "TypeSpec.uint64", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/uint64-collections/nullable-array", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "1411" - } - ], - "response": { - "type": { - "$ref": "1412" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableArray" - }, - { - "$id": "1415", - "kind": "basic", - "name": "getNullableRecord", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "operation": { - "$id": "1416", - "name": "getNullableRecord", - "isExactName": false, - "resourceName": "UInt64Collections", - "accessibility": "public", - "parameters": [ + }, { - "$id": "1417", + "$id": "1189", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "340" + "$ref": "292" }, "isApiVersion": false, "optional": false, @@ -23068,21 +19462,21 @@ "scope": "Constant", "readOnly": false, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "methodParameterSegments": [ { - "$id": "1418", + "$id": "1190", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "340" + "$ref": "292" }, "location": "Header", "isApiVersion": false, "optional": false, "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord.accept", + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "readOnly": false, "access": "public", "decorators": [], @@ -23098,28 +19492,7 @@ 200 ], "bodyType": { - "$id": "1419", - "kind": "dict", - "keyType": { - "$id": "1420", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1421", - "kind": "nullable", - "type": { - "$id": "1422", - "kind": "uint64", - "name": "uint64", - "crossLanguageDefinitionId": "TypeSpec.uint64", - "decorators": [] - }, - "namespace": "SampleTypeSpec" - }, - "decorators": [] + "$ref": "644" }, "headers": [], "isErrorResponse": false, @@ -23135,38 +19508,38 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/uint64-collections/nullable-record", + "path": "/notebooks/{notebookName}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord", + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook", "decorators": [], "namespace": "SampleTypeSpec" }, "parameters": [ { - "$ref": "1418" + "$ref": "1190" } ], "response": { "type": { - "$ref": "1419" + "$ref": "644" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.getNullableRecord" + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook" } ], "parameters": [ { - "$id": "1423", + "$id": "1191", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1424", + "$id": "1192", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -23178,19 +19551,22 @@ "serverUrlTemplate": "{sampleTypeSpecUrl}", "skipUrlEncoding": false, "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections.sampleTypeSpecUrl", + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.sampleTypeSpecUrl", "isExactName": false + }, + { + "$ref": "1187" } ], - "initializedBy": 0, + "initializedBy": 3, "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.UInt64Collections", + "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks", "apiVersions": [ "2024-07-16-preview", "2024-08-16-preview" ], "parent": { - "$ref": "808" + "$ref": "760" }, "isMultiServiceClient": false } From db18db6e8c9d0cd415814bdd75078ac84682893d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:41:52 +0000 Subject: [PATCH 4/7] test(http-client-csharp): cover nested integer JSON request serialization Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../ScmMethodProviderCollectionTests.cs | 29 +++++++++++ ...llectionRequestsUseBinaryContentHelpers.cs | 16 ++++++ .../ModelSerializationExtensionsTests.cs | 52 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index dcd4e2a81b4..f48ac40791b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -2528,6 +2528,35 @@ public void ListMethodIsRenamedToGet() } } + [TestCase(InputPrimitiveTypeKind.Int16)] + [TestCase(InputPrimitiveTypeKind.UInt16)] + [TestCase(InputPrimitiveTypeKind.UInt32)] + [TestCase(InputPrimitiveTypeKind.UInt64)] + public void NestedIntegerCollectionRequestsUseBinaryContentHelpers(InputPrimitiveTypeKind kind) + { + MockHelpers.LoadMockGenerator(); + var generatedCode = new StringBuilder(); + foreach (var isDictionary in new[] { false, true }) + { + var elementType = new InputPrimitiveType(kind, kind.ToString(), $"TypeSpec.{kind.ToString().ToLowerInvariant()}"); + var arrayType = InputFactory.Array(elementType); + var bodyType = isDictionary ? (InputType)InputFactory.Dictionary(arrayType) : InputFactory.Array(arrayType); + var name = isDictionary ? "SendRecord" : "SendNested"; + var operation = InputFactory.Operation(name, parameters: [InputFactory.BodyParameter("body", bodyType, isRequired: true)]); + var serviceMethod = InputFactory.BasicServiceMethod(name, operation, + parameters: [InputFactory.MethodParameter("body", bodyType, location: InputRequestLocation.Body, isRequired: true)]); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient)!; + var methods = new ScmMethodProviderCollection(serviceMethod, client); + foreach (var method in methods.Where(m => m.Kind == ScmMethodKind.Convenience)) + { + generatedCode.Append(method.BodyStatements!.ToDisplayString()); + } + } + + Assert.AreEqual(Helpers.GetExpectedFromFile(), generatedCode.ToString()); + } + [TestCase(InputPrimitiveTypeKind.Int16)] [TestCase(InputPrimitiveTypeKind.UInt16)] [TestCase(InputPrimitiveTypeKind.UInt32)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs new file mode 100644 index 00000000000..e65ce6d044d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs @@ -0,0 +1,16 @@ +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return this.SendNested(content, cancellationToken.ToRequestOptions()); +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return this.SendRecord(content, cancellationToken.ToRequestOptions()); +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs index 951b3b46c3d..103175845cc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ModelSerializationExtensionsTests.cs @@ -5,9 +5,11 @@ using System.Buffers; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Text.Json; +using System.Threading.Tasks; using NUnit.Framework; using SampleTypeSpec; @@ -34,6 +36,56 @@ public void WriteObjectValuePreservesIntegerRange(object value, string expected) Assert.AreEqual(expected, Encoding.UTF8.GetString(buffer.WrittenSpan)); } + private static IEnumerable NestedIntegerCollections() + => IntegerCollections(short.MinValue, short.MaxValue, "-32768,32767") + .Concat(IntegerCollections(ushort.MinValue, ushort.MaxValue, "0,65535")) + .Concat(IntegerCollections(uint.MinValue, uint.MaxValue, "0,4294967295")) + .Concat(IntegerCollections(ulong.MinValue, ulong.MaxValue, "0,18446744073709551615")); + + private static IEnumerable IntegerCollections(T min, T max, string numbers) where T : struct + { + (object Collection, string Expected)[] collections = + [ + (new T[] { min, max }, $"[{numbers}]"), + (new List { min, max }, $"[{numbers}]"), + (new T?[] { min, null, max }, $"[{numbers.Replace(",", ",null,")}]"), + (Array.Empty(), "[]") + ]; + foreach (var (collection, expected) in collections) + { + foreach (var isDictionary in new[] { false, true }) + { + foreach (var isAsync in new[] { false, true }) + { + yield return new TestCaseData(collection, expected, isDictionary, isAsync); + } + } + } + } + + [TestCaseSource(nameof(NestedIntegerCollections))] + public async Task NestedIntegerRequestBodiesSerialize( + object collection, + string expected, + bool isDictionary, + bool isAsync) + { + using var content = isDictionary + ? BinaryContentHelper.FromDictionary(new Dictionary { ["numbers"] = collection }) + : BinaryContentHelper.FromEnumerable(new[] { collection }); + using var stream = new MemoryStream(); + if (isAsync) + { + await content.WriteToAsync(stream, default); + } + else + { + content.WriteTo(stream, default); + } + + Assert.AreEqual(isDictionary ? $"{{\"numbers\":{expected}}}" : $"[{expected}]", Encoding.UTF8.GetString(stream.ToArray())); + } + [Test] public void WriteObjectValuePreservesDictionaryAndByteArrayHandling() { From 580de7cc3194f4c9eab43fef87f8f9535397f917 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:07:07 +0000 Subject: [PATCH 5/7] test(http-client-csharp): clarify integer collection baselines Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../ModelSerializationExtensionsDefinition.cs | 2 +- ...bjectValueIncludesFileBinaryContentCase.cs | 2 +- ...ctValueXmlIncludesFileBinaryContentCase.cs | 2 +- .../ScmMethodProviderCollectionTests.cs | 15 +++++++++++++- ...ectionResponsesUseUtf8JsonReader(Int16).cs | 8 ++++++++ ...ctionResponsesUseUtf8JsonReader(UInt16).cs | 8 ++++++++ ...ctionResponsesUseUtf8JsonReader(UInt32).cs | 8 ++++++++ ...ctionResponsesUseUtf8JsonReader(UInt64).cs | 8 ++++++++ ...nRequestsUseBinaryContentHelpers(Int16).cs | 20 +++++++++++++++++++ ...RequestsUseBinaryContentHelpers(UInt16).cs | 20 +++++++++++++++++++ ...equestsUseBinaryContentHelpers(UInt32).cs} | 4 ++++ ...RequestsUseBinaryContentHelpers(UInt64).cs | 20 +++++++++++++++++++ .../src/Statements/ForEachStatement.cs | 7 +++++++ 13 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs => NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs} (51%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs index 88361ec5d95..15991998f8d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs @@ -758,7 +758,7 @@ private MethodProvider BuildWriteObjectValueMethodGeneric() objectEnumerable => new MethodBodyStatement[] { writer.WriteStartArray(), - new ForEachStatement(typeof(object), "item", objectEnumerable, false, out var item) + new ForEachStatement("item", objectEnumerable, typeof(object), out var item) { writer.WriteObjectValue(item.As(), options) }, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs index 1213ca8f10a..0f15aab2591 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueIncludesFileBinaryContentCase.cs @@ -92,7 +92,7 @@ public static void WriteObjectValue(this global::System.Text.Json.Utf8JsonWri break; case global::System.Collections.IEnumerable objectEnumerable: writer.WriteStartArray(); - foreach (object item in objectEnumerable) + foreach (var item in objectEnumerable) { writer.WriteObjectValue(item, options); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs index 62f1ef10871..f65f3f20981 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelSerializationExtensionsDefinitionTests/ValidateWriteObjectValueXmlIncludesFileBinaryContentCase.cs @@ -94,7 +94,7 @@ public static void WriteObjectValue(this global::System.Text.Json.Utf8JsonWri break; case global::System.Collections.IEnumerable objectEnumerable: writer.WriteStartArray(); - foreach (object item in objectEnumerable) + foreach (var item in objectEnumerable) { writer.WriteObjectValue(item, options); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index f48ac40791b..af99122c454 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -2550,11 +2550,12 @@ public void NestedIntegerCollectionRequestsUseBinaryContentHelpers(InputPrimitiv var methods = new ScmMethodProviderCollection(serviceMethod, client); foreach (var method in methods.Where(m => m.Kind == ScmMethodKind.Convenience)) { + AppendMethodSignature(generatedCode, method); generatedCode.Append(method.BodyStatements!.ToDisplayString()); } } - Assert.AreEqual(Helpers.GetExpectedFromFile(), generatedCode.ToString()); + Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), generatedCode.ToString()); } [TestCase(InputPrimitiveTypeKind.Int16)] @@ -2583,6 +2584,7 @@ public void IntegerCollectionResponsesUseUtf8JsonReader(InputPrimitiveTypeKind k var methods = new ScmMethodProviderCollection(serviceMethod, client); foreach (var method in methods.Where(m => m.Kind == ScmMethodKind.Convenience)) { + AppendMethodSignature(generatedCode, method); generatedCode.Append(method.BodyStatements!.ToDisplayString()); } } @@ -2591,6 +2593,17 @@ public void IntegerCollectionResponsesUseUtf8JsonReader(InputPrimitiveTypeKind k Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), generatedCode.ToString()); } + private static void AppendMethodSignature(StringBuilder generatedCode, MethodProvider method) + { + generatedCode.Append("// ") + .Append(method.Signature.ReturnType) + .Append(' ') + .Append(method.Signature.Name) + .Append('(') + .Append(string.Join(", ", method.Signature.Parameters.Select(parameter => $"{parameter.Type} {parameter.Name}"))) + .AppendLine(")"); + } + [TestCase(typeof(int))] [TestCase(typeof(int), true)] [TestCase(typeof(int?))] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs index 9a7522546fe..6d47018ae49 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs @@ -1,3 +1,4 @@ +// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -12,6 +13,7 @@ value.Add(jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -26,6 +28,7 @@ value.Add(jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -40,6 +43,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -54,6 +58,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -70,6 +75,7 @@ value.Add(propertyName, jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -86,6 +92,7 @@ value.Add(propertyName, jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -102,6 +109,7 @@ value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs index c18855ecc79..84bce2a9bcf 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs @@ -1,3 +1,4 @@ +// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -12,6 +13,7 @@ value.Add(jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -26,6 +28,7 @@ value.Add(jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -40,6 +43,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -54,6 +58,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -70,6 +75,7 @@ value.Add(propertyName, jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -86,6 +92,7 @@ value.Add(propertyName, jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -102,6 +109,7 @@ value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs index af09776ac91..7e9c5eada82 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs @@ -1,3 +1,4 @@ +// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -12,6 +13,7 @@ value.Add(jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -26,6 +28,7 @@ value.Add(jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -40,6 +43,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -54,6 +58,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -70,6 +75,7 @@ value.Add(propertyName, jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -86,6 +92,7 @@ value.Add(propertyName, jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -102,6 +109,7 @@ value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs index 2044c782d0e..10755c15a30 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs @@ -1,3 +1,4 @@ +// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -12,6 +13,7 @@ value.Add(jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -26,6 +28,7 @@ value.Add(jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -40,6 +43,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -54,6 +58,7 @@ value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -70,6 +75,7 @@ value.Add(propertyName, jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -86,6 +92,7 @@ value.Add(propertyName, jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; @@ -102,6 +109,7 @@ value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); global::System.BinaryData data = result.GetRawResponse().Content; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs new file mode 100644 index 00000000000..f98999f4502 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs @@ -0,0 +1,20 @@ +// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return this.SendNested(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return this.SendRecord(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs new file mode 100644 index 00000000000..dc16d1cbab3 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs @@ -0,0 +1,20 @@ +// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return this.SendNested(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return this.SendRecord(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs similarity index 51% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs index e65ce6d044d..09eef00088a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs @@ -1,15 +1,19 @@ +// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) global::Sample.Argument.AssertNotNull(body, nameof(body)); using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); return this.SendNested(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) global::Sample.Argument.AssertNotNull(body, nameof(body)); using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) global::Sample.Argument.AssertNotNull(body, nameof(body)); using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); return this.SendRecord(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) global::Sample.Argument.AssertNotNull(body, nameof(body)); using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs new file mode 100644 index 00000000000..75f0427b6fc --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs @@ -0,0 +1,20 @@ +// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return this.SendNested(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); +return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return this.SendRecord(content, cancellationToken.ToRequestOptions()); +// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) +global::Sample.Argument.AssertNotNull(body, nameof(body)); + +using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); +return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs index a7a07eb4baf..3e754fefc91 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs @@ -38,6 +38,13 @@ public ForEachStatement(CSharpType itemType, string itemName, ValueExpression en ItemVariable = item; } + public ForEachStatement(string itemName, ValueExpression enumerable, CSharpType itemType, out VariableExpression item) + : this(null, new CodeWriterDeclaration(itemName), enumerable, false) + { + item = new VariableExpression(itemType, Item); + ItemVariable = item; + } + public ForEachStatement(string itemName, ScopedApi enumerable, out VariableExpression item) : this(null, new CodeWriterDeclaration(itemName), enumerable, false) { From 334085c3055d51a7a2db4d404a47ca6dde97bf93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 20:53:57 +0000 Subject: [PATCH 6/7] test(http-client-csharp): sync generated enumerable loop Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Generated/Internal/ModelSerializationExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs index a21365f4814..3d4ae845a2c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs @@ -321,7 +321,7 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, T value, Mode break; case IEnumerable objectEnumerable: writer.WriteStartArray(); - foreach (object item in objectEnumerable) + foreach (var item in objectEnumerable) { writer.WriteObjectValue(item, options); } From 16f0c0e95ac846a24c77ee571c2bc50fa932ff42 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Oct 2026 21:08:18 +0000 Subject: [PATCH 7/7] test(http-client-csharp): render method signatures and reuse foreach constructors Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../ModelSerializationExtensionsDefinition.cs | 2 +- .../ScmMethodProviderCollectionTests.cs | 25 +-- ...ectionResponsesUseUtf8JsonReader(Int16).cs | 208 ++++++++++-------- ...ctionResponsesUseUtf8JsonReader(UInt16).cs | 208 ++++++++++-------- ...ctionResponsesUseUtf8JsonReader(UInt32).cs | 208 ++++++++++-------- ...ctionResponsesUseUtf8JsonReader(UInt64).cs | 208 ++++++++++-------- ...nRequestsUseBinaryContentHelpers(Int16).cs | 40 ++-- ...RequestsUseBinaryContentHelpers(UInt16).cs | 40 ++-- ...RequestsUseBinaryContentHelpers(UInt32).cs | 40 ++-- ...RequestsUseBinaryContentHelpers(UInt64).cs | 40 ++-- .../src/Statements/ForEachStatement.cs | 11 +- .../test/Statements/StatementTests.cs | 11 + ...mentInfersObjectForNonGenericEnumerable.cs | 3 + 13 files changed, 567 insertions(+), 477 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/TestData/StatementTests/ForeachStatementInfersObjectForNonGenericEnumerable.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs index 15991998f8d..0d82cb8d6c3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs @@ -758,7 +758,7 @@ private MethodProvider BuildWriteObjectValueMethodGeneric() objectEnumerable => new MethodBodyStatement[] { writer.WriteStartArray(), - new ForEachStatement("item", objectEnumerable, typeof(object), out var item) + new ForEachStatement("item", objectEnumerable.As(), out var item) { writer.WriteObjectValue(item.As(), options) }, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index af99122c454..31fe80ae1a3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -2535,7 +2535,7 @@ public void ListMethodIsRenamedToGet() public void NestedIntegerCollectionRequestsUseBinaryContentHelpers(InputPrimitiveTypeKind kind) { MockHelpers.LoadMockGenerator(); - var generatedCode = new StringBuilder(); + using var writer = new CodeWriter(); foreach (var isDictionary in new[] { false, true }) { var elementType = new InputPrimitiveType(kind, kind.ToString(), $"TypeSpec.{kind.ToString().ToLowerInvariant()}"); @@ -2550,12 +2550,11 @@ public void NestedIntegerCollectionRequestsUseBinaryContentHelpers(InputPrimitiv var methods = new ScmMethodProviderCollection(serviceMethod, client); foreach (var method in methods.Where(m => m.Kind == ScmMethodKind.Convenience)) { - AppendMethodSignature(generatedCode, method); - generatedCode.Append(method.BodyStatements!.ToDisplayString()); + writer.WriteMethod(method); } } - Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), generatedCode.ToString()); + Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), writer.ToString(false)); } [TestCase(InputPrimitiveTypeKind.Int16)] @@ -2565,7 +2564,7 @@ public void NestedIntegerCollectionRequestsUseBinaryContentHelpers(InputPrimitiv public void IntegerCollectionResponsesUseUtf8JsonReader(InputPrimitiveTypeKind kind) { MockHelpers.LoadMockGenerator(); - var generatedCode = new StringBuilder(); + using var writer = new CodeWriter(); foreach (var isDictionary in new[] { false, true }) { foreach (var isNullable in new[] { false, true }) @@ -2584,24 +2583,12 @@ public void IntegerCollectionResponsesUseUtf8JsonReader(InputPrimitiveTypeKind k var methods = new ScmMethodProviderCollection(serviceMethod, client); foreach (var method in methods.Where(m => m.Kind == ScmMethodKind.Convenience)) { - AppendMethodSignature(generatedCode, method); - generatedCode.Append(method.BodyStatements!.ToDisplayString()); + writer.WriteMethod(method); } } } - Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), generatedCode.ToString()); - } - - private static void AppendMethodSignature(StringBuilder generatedCode, MethodProvider method) - { - generatedCode.Append("// ") - .Append(method.Signature.ReturnType) - .Append(' ') - .Append(method.Signature.Name) - .Append('(') - .Append(string.Join(", ", method.Signature.Parameters.Select(parameter => $"{parameter.Type} {parameter.Name}"))) - .AppendLine(")"); + Assert.AreEqual(Helpers.GetExpectedFromFile(kind.ToString()), writer.ToString(false)); } [TestCase(typeof(int))] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs index 6d47018ae49..a959792c795 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(Int16).cs @@ -1,128 +1,144 @@ -// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetInt16()); } - value.Add(jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetInt16()); } - value.Add(jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs index 84bce2a9bcf..376f7318a94 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt16).cs @@ -1,128 +1,144 @@ -// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt16()); } - value.Add(jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt16()); } - value.Add(jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt16()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs index 7e9c5eada82..65fd414e6fc 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt32).cs @@ -1,128 +1,144 @@ -// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt32()); } - value.Add(jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt32()); } - value.Add(jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt32()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt32()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt32()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs index 10755c15a30..0f2b61f9924 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/IntegerCollectionResponsesUseUtf8JsonReader(UInt64).cs @@ -1,128 +1,144 @@ -// global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt64()); } - value.Add(jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetUInt64()); } - value.Add(jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableList(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = this.GetNullableList(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableListAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + global::System.ClientModel.ClientResult result = await this.GetNullableListAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } - value.Add((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt64()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetUInt64()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual global::System.ClientModel.ClientResult> GetNullableDictionary(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = this.GetNullableDictionary(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); -// global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken) -global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); -global::System.BinaryData data = result.GetRawResponse().Content; -global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); -jsonReader.Read(); -while (jsonReader.Read()) +public virtual async global::System.Threading.Tasks.Task>> GetNullableDictionaryAsync(global::System.Threading.CancellationToken cancellationToken = default) { - if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + global::System.ClientModel.ClientResult result = await this.GetNullableDictionaryAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) { - break; + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); } - string propertyName = jsonReader.GetString(); - jsonReader.Read(); - value.Add(propertyName, (jsonReader.TokenType == global::System.Text.Json.JsonTokenType.Null) ? null : jsonReader.GetUInt64()); + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); } -return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs index f98999f4502..62e2ec99a9a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(Int16).cs @@ -1,20 +1,28 @@ -// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); +public virtual global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return this.SendNested(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return this.SendNested(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} +public virtual global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return this.SendRecord(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return this.SendRecord(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs index dc16d1cbab3..1f0fe2a3f5b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt16).cs @@ -1,20 +1,28 @@ -// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); +public virtual global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return this.SendNested(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return this.SendNested(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} +public virtual global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return this.SendRecord(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return this.SendRecord(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs index 09eef00088a..99ab9612f46 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt32).cs @@ -1,20 +1,28 @@ -// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); +public virtual global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return this.SendNested(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return this.SendNested(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} +public virtual global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return this.SendRecord(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return this.SendRecord(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs index 75f0427b6fc..7038a7059a9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/NestedIntegerCollectionRequestsUseBinaryContentHelpers(UInt64).cs @@ -1,20 +1,28 @@ -// global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); +public virtual global::System.ClientModel.ClientResult SendNested(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return this.SendNested(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return this.SendNested(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendNestedAsync(global::System.Collections.Generic.IEnumerable> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); -return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -// global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromEnumerable(body); + return await this.SendNestedAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} +public virtual global::System.ClientModel.ClientResult SendRecord(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return this.SendRecord(content, cancellationToken.ToRequestOptions()); -// global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken) -global::Sample.Argument.AssertNotNull(body, nameof(body)); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return this.SendRecord(content, cancellationToken.ToRequestOptions()); +} +public virtual async global::System.Threading.Tasks.Task SendRecordAsync(global::System.Collections.Generic.IDictionary> body, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNull(body, nameof(body)); -using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); -return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.ClientModel.BinaryContent content = global::Sample.BinaryContentHelper.FromDictionary(body); + return await this.SendRecordAsync(content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs index 3e754fefc91..fffa9b07668 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/ForEachStatement.cs @@ -38,24 +38,17 @@ public ForEachStatement(CSharpType itemType, string itemName, ValueExpression en ItemVariable = item; } - public ForEachStatement(string itemName, ValueExpression enumerable, CSharpType itemType, out VariableExpression item) - : this(null, new CodeWriterDeclaration(itemName), enumerable, false) - { - item = new VariableExpression(itemType, Item); - ItemVariable = item; - } - public ForEachStatement(string itemName, ScopedApi enumerable, out VariableExpression item) : this(null, new CodeWriterDeclaration(itemName), enumerable, false) { - item = new VariableExpression(enumerable.Type.Arguments[0], Item); + item = new VariableExpression(enumerable.Type.Equals(typeof(System.Collections.IEnumerable)) ? typeof(object) : enumerable.Type.Arguments[0], Item); ItemVariable = item; } public ForEachStatement(string itemName, ScopedApi enumerable, bool isAsync, out VariableExpression item) : this(null, new CodeWriterDeclaration(itemName), enumerable, isAsync) { - item = new VariableExpression(enumerable.Type.Arguments[0], Item); + item = new VariableExpression(enumerable.Type.Equals(typeof(System.Collections.IEnumerable)) ? typeof(object) : enumerable.Type.Arguments[0], Item); ItemVariable = item; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/StatementTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/StatementTests.cs index c0c34d56ead..297766d52b9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/StatementTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/StatementTests.cs @@ -96,6 +96,17 @@ public void CreateForeachStatement() Assert.AreEqual(itemName, itemReference.Declaration.RequestedName); } + [Test] + public void ForeachStatementInfersObjectForNonGenericEnumerable() + { + var enumerable = new VariableExpression(typeof(System.Collections.IEnumerable), "values").As(); + var statement = new ForEachStatement("item", enumerable, out var item); + + Assert.IsNull(statement.ItemType); + Assert.AreEqual(new CSharpType(typeof(object)), item.Type); + Assert.AreEqual(Helpers.GetExpectedFromFile(), statement.ToDisplayString()); + } + [Test] public void ForeachStatementWithAddMethod() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/TestData/StatementTests/ForeachStatementInfersObjectForNonGenericEnumerable.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/TestData/StatementTests/ForeachStatementInfersObjectForNonGenericEnumerable.cs new file mode 100644 index 00000000000..83cf718127c --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Statements/TestData/StatementTests/ForeachStatementInfersObjectForNonGenericEnumerable.cs @@ -0,0 +1,3 @@ +foreach (var item in values) +{ +}