diff --git a/src/AutoRest.CSharp/Properties/launchSettings.json b/src/AutoRest.CSharp/Properties/launchSettings.json index e54686ed98d..a05a1a3e4b0 100644 --- a/src/AutoRest.CSharp/Properties/launchSettings.json +++ b/src/AutoRest.CSharp/Properties/launchSettings.json @@ -456,10 +456,6 @@ "commandName": "Project", "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestProjects\\MgmtXmlDeserialization\\src\\Generated -n" }, - "MixAPIVersion-TypeSpec": { - "commandName": "Project", - "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestProjects\\MixAPIVersion-TypeSpec\\src\\Generated -n" - }, "model-flattening": { "commandName": "Project", "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestServerProjects\\model-flattening\\Generated" diff --git a/test/AutoRest.TestServer.Tests/ConvenienceMethodTests.cs b/test/AutoRest.TestServer.Tests/ConvenienceMethodTests.cs index dda08c560a5..9506622d2f5 100644 --- a/test/AutoRest.TestServer.Tests/ConvenienceMethodTests.cs +++ b/test/AutoRest.TestServer.Tests/ConvenienceMethodTests.cs @@ -7,7 +7,6 @@ using Azure.Core; using ConvenienceInCadl; using ConvenienceInCadl.Models; -using MixApiVersion; using NUnit.Framework; namespace AutoRest.TestServer.Tests @@ -234,18 +233,5 @@ public void NoConvenienceOptionalBodyScenario() var protocolInUpdate = typeof(ConvenienceInCadlClient).GetMethod("NoConvenienceOptionalBody"); Assert.AreEqual(true, protocolInUpdate.GetParameters().Last().IsOptional); } - - [Test] - public void SetKeepNonOverloadableProtocolSignature() - { - var getPetsClientMethod = typeof(MixApiVersionClient).GetMethod("GetPetsClient"); - Assert.AreEqual(typeof(Pets), getPetsClientMethod.ReturnType); - - var method = getPetsClientMethod.ReturnType.GetMethod("Delete"); - Assert.AreEqual(true, method.GetParameters().Last().IsOptional); - - method = getPetsClientMethod.ReturnType.GetMethod("Read"); - Assert.AreEqual(false, method.GetParameters().Last().IsOptional); - } } } diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/Configuration.json b/test/TestProjects/MixAPIVersion-TypeSpec/Configuration.json deleted file mode 100644 index 8f56b98671f..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/Configuration.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "output-folder": ".", - "namespace": "MixApiVersion", - "library-name": "MixApiVersion", - "flavor": "azure", - "use-model-reader-writer": true, - "shared-source-folders": [ - "../../../../../artifacts/bin/AutoRest.CSharp/Debug/net8.0/Generator.Shared", - "../../../../../artifacts/bin/AutoRest.CSharp/Debug/net8.0/Azure.Core.Shared" - ] -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion-TypeSpec.tsp b/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion-TypeSpec.tsp deleted file mode 100644 index 424faedac2c..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion-TypeSpec.tsp +++ /dev/null @@ -1,100 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; -import "@typespec/versioning"; -import "@azure-tools/typespec-client-generator-core"; -import "@azure-tools/typespec-azure-core"; - -using TypeSpec.Http; -using TypeSpec.Rest; -using TypeSpec.Versioning; -using Azure.Core; - -@versioned(Versions) -@service({title:"PetStore"}) -@doc("This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") -@server( - "{petStoreUrl}", - "Endpoint Service", - { - petStoreUrl: string, - } -) -namespace MixApiVersion; - -enum Versions { - @useDependency(Azure.Core.Versions.v1_0_Preview_1) - "2022-11-30-preview" -} - -// Model types -@doc("Pet") -@resource("Pet") -model Pet { - @key - @visibility("read") - @doc("pet name") - name: string; - tag?: string; - - @minValue(0) - @maxValue(20) - age: int32; -} - -@resource("Toy") -model Toy { - @key - @visibility("read") - id: int64; - petId: int64; - name: string; -} - -@doc("Error") -@error -model Error { - code: int32; - message: string; -} - -@doc("Not modified") -model NotModified { - @statusCode _: 304; - @body body: T; -} - -@friendlyName("{name}ListResults", T) -model ResponsePage { - items: T[]; - nextLink?: string; -} - -model PetId { - @path - @doc("The id of pet.") - petId: int32; -} - -@doc("Manage your pets. You can delete or get the Pet from pet store.") -@summary("Manage your pets.") -@route("/pets") -namespace Pets { - @doc("Delete a pet.") - @summary("delete.") - op delete is ResourceDelete; - - @doc("Returns a pet. Supports eTags.") - op read(...PetId): Pet | NotModified | Error; - - @post op create(@body pet: Pet, @query apiVersion: "2022-07-09"): Pet | Error; -} - -@route("/pets/toys") - -namespace ListPetToysResponse { - - @summary("Gets ledger entries from a collection corresponding to a range.") - @doc("A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.") - op listPet is Azure.Core.ResourceList; - -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion.sln b/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion.sln deleted file mode 100644 index 2836f614665..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion.sln +++ /dev/null @@ -1,50 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29709.97 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixApiVersion", "src\MixApiVersion.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixApiVersion.Tests", "tests\MixApiVersion.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} - EndGlobalSection -EndGlobal diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/ListPetToysResponse.xml b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/ListPetToysResponse.xml deleted file mode 100644 index 09c6b3561ad..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/ListPetToysResponse.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - -This sample shows how to call GetPetsAsync and parse the result. -"); -ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - -await foreach (BinaryData item in client.GetPetsAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); -} -]]> -This sample shows how to call GetPetsAsync with all parameters and parse the result. -"); -ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - -await foreach (BinaryData item in client.GetPetsAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); -} -]]> - - - -This sample shows how to call GetPets and parse the result. -"); -ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - -foreach (BinaryData item in client.GetPets(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); -} -]]> -This sample shows how to call GetPets with all parameters and parse the result. -"); -ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - -foreach (BinaryData item in client.GetPets(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); -} -]]> - - - \ No newline at end of file diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/Pets.xml b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/Pets.xml deleted file mode 100644 index 6011d113264..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/Pets.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - -This sample shows how to call DeleteAsync. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - -Response response = await client.DeleteAsync(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteAsync with all parameters. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - -Response response = await client.DeleteAsync(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call Delete. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - -Response response = client.Delete(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call Delete with all parameters. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - -Response response = client.Delete(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call ReadAsync and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - -Response response = await client.ReadAsync(1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> -This sample shows how to call ReadAsync with all parameters and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - -Response response = await client.ReadAsync(1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("tag").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> - - - -This sample shows how to call Read and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - -Response response = client.Read(1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> -This sample shows how to call Read with all parameters and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - -Response response = client.Read(1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("tag").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> - - - -This sample shows how to call CreateAsync and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - -using RequestContent content = RequestContent.Create(new -{ - age = 1234, -}); -Response response = await client.CreateAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> -This sample shows how to call CreateAsync with all request content and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - -using RequestContent content = RequestContent.Create(new -{ - tag = "", - age = 1234, -}); -Response response = await client.CreateAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("tag").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> - - - -This sample shows how to call Create and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - -using RequestContent content = RequestContent.Create(new -{ - age = 1234, -}); -Response response = client.Create(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> -This sample shows how to call Create with all request content and parse the result. -"); -Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - -using RequestContent content = RequestContent.Create(new -{ - tag = "", - age = 1234, -}); -Response response = client.Create(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("tag").ToString()); -Console.WriteLine(result.GetProperty("age").ToString()); -]]> - - - \ No newline at end of file diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Internal/Argument.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Internal/Argument.cs deleted file mode 100644 index 1b0eca05e09..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Internal/Argument.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace MixApiVersion -{ - internal static class Argument - { - public static void AssertNotNull(T value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - } - - public static void AssertNotNull(T? value, string name) - where T : struct - { - if (!value.HasValue) - { - throw new ArgumentNullException(name); - } - } - - public static void AssertNotNullOrEmpty(IEnumerable value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (value is ICollection collectionOfT && collectionOfT.Count == 0) - { - throw new ArgumentException("Value cannot be an empty collection.", name); - } - if (value is ICollection collection && collection.Count == 0) - { - throw new ArgumentException("Value cannot be an empty collection.", name); - } - using IEnumerator e = value.GetEnumerator(); - if (!e.MoveNext()) - { - throw new ArgumentException("Value cannot be an empty collection.", name); - } - } - - public static void AssertNotNullOrEmpty(string value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (value.Length == 0) - { - throw new ArgumentException("Value cannot be an empty string.", name); - } - } - - public static void AssertNotNullOrWhiteSpace(string value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); - } - } - - public static void AssertNotDefault(ref T value, string name) - where T : struct, IEquatable - { - if (value.Equals(default)) - { - throw new ArgumentException("Value cannot be empty.", name); - } - } - - public static void AssertInRange(T value, T minimum, T maximum, string name) - where T : notnull, IComparable - { - if (minimum.CompareTo(value) > 0) - { - throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); - } - if (maximum.CompareTo(value) < 0) - { - throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); - } - } - - public static void AssertEnumDefined(Type enumType, object value, string name) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); - } - } - - public static T CheckNotNull(T value, string name) - where T : class - { - AssertNotNull(value, name); - return value; - } - - public static string CheckNotNullOrEmpty(string value, string name) - { - AssertNotNullOrEmpty(value, name); - return value; - } - - public static void AssertNull(T value, string name, string message = null) - { - if (value != null) - { - throw new ArgumentException(message ?? "Value must be null.", name); - } - } - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/ListPetToysResponse.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/ListPetToysResponse.cs deleted file mode 100644 index 0c1ec29fa0b..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/ListPetToysResponse.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace MixApiVersion -{ - // Data plane generated sub-client. - /// The ListPetToysResponse sub-client. - public partial class ListPetToysResponse - { - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// The ClientDiagnostics is used to provide tracing support for the client library. - internal ClientDiagnostics ClientDiagnostics { get; } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public virtual HttpPipeline Pipeline => _pipeline; - - /// Initializes a new instance of ListPetToysResponse for mocking. - protected ListPetToysResponse() - { - } - - /// Initializes a new instance of ListPetToysResponse. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The to use. - /// The API version to use for this operation. - internal ListPetToysResponse(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) - { - ClientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - _endpoint = endpoint; - _apiVersion = apiVersion; - } - - /// - /// [Protocol Method] Gets ledger entries from a collection corresponding to a range. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetPetsAsync(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPetsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPetsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ListPetToysResponse.GetPets", "value", "nextLink", context); - } - - /// - /// [Protocol Method] Gets ledger entries from a collection corresponding to a range. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetPets(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPetsRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPetsNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ListPetToysResponse.GetPets", "value", "nextLink", context); - } - - internal HttpMessage CreateGetPetsRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/pets/toys/Toy", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetPetsNextPageRequest(string nextLink, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - private static ResponseClassifier _responseClassifier200; - private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClient.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClient.cs deleted file mode 100644 index 3ebf4dcfa2a..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClient.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace MixApiVersion -{ - // Data plane generated client. - /// This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - public partial class MixApiVersionClient - { - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - - /// The ClientDiagnostics is used to provide tracing support for the client library. - internal ClientDiagnostics ClientDiagnostics { get; } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public virtual HttpPipeline Pipeline => _pipeline; - - /// Initializes a new instance of MixApiVersionClient for mocking. - protected MixApiVersionClient() - { - } - - /// Initializes a new instance of MixApiVersionClient. - /// The to use. - /// is null. - public MixApiVersionClient(Uri endpoint) : this(endpoint, new MixApiVersionClientOptions()) - { - } - - /// Initializes a new instance of MixApiVersionClient. - /// The to use. - /// The options for configuring the client. - /// is null. - public MixApiVersionClient(Uri endpoint, MixApiVersionClientOptions options) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - options ??= new MixApiVersionClientOptions(); - - ClientDiagnostics = new ClientDiagnostics(options, true); - _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), Array.Empty(), new ResponseClassifier()); - _endpoint = endpoint; - } - - /// Initializes a new instance of Pets. - /// The API version to use for this operation. - /// is null. - public virtual Pets GetPetsClient(string apiVersion = "2022-11-30-preview") - { - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - - return new Pets(ClientDiagnostics, _pipeline, _endpoint, apiVersion); - } - - /// Initializes a new instance of ListPetToysResponse. - /// The API version to use for this operation. - /// is null. - public virtual ListPetToysResponse GetListPetToysResponseClient(string apiVersion = "2022-11-30-preview") - { - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - - return new ListPetToysResponse(ClientDiagnostics, _pipeline, _endpoint, apiVersion); - } - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClientBuilderExtensions.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClientBuilderExtensions.cs deleted file mode 100644 index d7372837d3c..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClientBuilderExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core.Extensions; -using MixApiVersion; - -namespace Microsoft.Extensions.Azure -{ - /// Extension methods to add to client builder. - public static partial class MixApiVersionClientBuilderExtensions - { - /// Registers a instance. - /// The builder to register with. - /// The to use. - public static IAzureClientBuilder AddMixApiVersionClient(this TBuilder builder, Uri endpoint) - where TBuilder : IAzureClientFactoryBuilder - { - return builder.RegisterClientFactory((options) => new MixApiVersionClient(endpoint, options)); - } - - /// Registers a instance. - /// The builder to register with. - /// The configuration values. - public static IAzureClientBuilder AddMixApiVersionClient(this TBuilder builder, TConfiguration configuration) - where TBuilder : IAzureClientFactoryBuilderWithConfiguration - { - return builder.RegisterClientFactory(configuration); - } - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClientOptions.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClientOptions.cs deleted file mode 100644 index 3abcd76706b..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/MixApiVersionClientOptions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace MixApiVersion -{ - /// Client options for MixApiVersionClient. - public partial class MixApiVersionClientOptions : ClientOptions - { - private const ServiceVersion LatestVersion = ServiceVersion.V2022_11_30_Preview; - - /// The version of the service to use. - public enum ServiceVersion - { - /// Service version "2022-11-30-preview". - V2022_11_30_Preview = 1, - } - - internal string Version { get; } - - /// Initializes new instance of MixApiVersionClientOptions. - public MixApiVersionClientOptions(ServiceVersion version = LatestVersion) - { - Version = version switch - { - ServiceVersion.V2022_11_30_Preview => "2022-11-30-preview", - _ => throw new NotSupportedException() - }; - } - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Pets.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Pets.cs deleted file mode 100644 index a10393d8c61..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Pets.cs +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace MixApiVersion -{ - // Data plane generated sub-client. - /// Manage your pets. - public partial class Pets - { - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// The ClientDiagnostics is used to provide tracing support for the client library. - internal ClientDiagnostics ClientDiagnostics { get; } - - /// The HTTP pipeline for sending and receiving REST requests and responses. - public virtual HttpPipeline Pipeline => _pipeline; - - /// Initializes a new instance of Pets for mocking. - protected Pets() - { - } - - /// Initializes a new instance of Pets. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The to use. - /// The API version to use for this operation. - internal Pets(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) - { - ClientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - _endpoint = endpoint; - _apiVersion = apiVersion; - } - - /// - /// [Protocol Method] delete. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// pet name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteAsync(string name, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var scope = ClientDiagnostics.CreateScope("Pets.Delete"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteRequest(name, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] delete. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// pet name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response Delete(string name, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var scope = ClientDiagnostics.CreateScope("Pets.Delete"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteRequest(name, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Returns a pet. Supports eTags. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The id of pet. - /// The request context, 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 ReadAsync(int petId, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("Pets.Read"); - scope.Start(); - try - { - using HttpMessage message = CreateReadRequest(petId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Returns a pet. Supports eTags. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The id of pet. - /// The request context, 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 Response Read(int petId, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("Pets.Read"); - scope.Start(); - try - { - using HttpMessage message = CreateReadRequest(petId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Create. - /// - /// - /// - /// 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 context, 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 CreateAsync(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("Pets.Create"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateRequest(content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Create. - /// - /// - /// - /// 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 context, 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 Response Create(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("Pets.Create"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateRequest(content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - internal HttpMessage CreateDeleteRequest(string name, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/pets/Pet/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateReadRequest(int petId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200304); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/pets/", false); - uri.AppendPath(petId, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/pets", false); - uri.AppendQuery("apiVersion", "2022-07-09", true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - private static ResponseClassifier _responseClassifier204; - private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); - private static ResponseClassifier _responseClassifier200304; - private static ResponseClassifier ResponseClassifier200304 => _responseClassifier200304 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 304 }); - private static ResponseClassifier _responseClassifier200; - private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/MixAPIVersion.csproj b/test/TestProjects/MixAPIVersion-TypeSpec/src/MixAPIVersion.csproj deleted file mode 100644 index fd46ffeb533..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/MixAPIVersion.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - This is the MixApiVersion client library for developing .NET applications with rich experience. - Azure SDK Code Generation MixApiVersion for Azure Data Plane - 1.0.0-beta.1 - MixApiVersion - $(RequiredTargetFrameworks) - true - - - - - - - - - - - diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Properties/AssemblyInfo.cs b/test/TestProjects/MixAPIVersion-TypeSpec/src/Properties/AssemblyInfo.cs deleted file mode 100644 index d24466b8135..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("MixApiVersion.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_ListPetToysResponse.cs b/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_ListPetToysResponse.cs deleted file mode 100644 index cc4e25d269d..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_ListPetToysResponse.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading.Tasks; -using Azure; -using Azure.Identity; -using NUnit.Framework; - -namespace MixApiVersion.Samples -{ - public partial class Samples_ListPetToysResponse - { - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Toy_GetPets_ShortVersion() - { - Uri endpoint = new Uri(""); - ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - - foreach (BinaryData item in client.GetPets(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Toy_GetPets_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - - await foreach (BinaryData item in client.GetPetsAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Toy_GetPets_AllParameters() - { - Uri endpoint = new Uri(""); - ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - - foreach (BinaryData item in client.GetPets(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Toy_GetPets_AllParameters_Async() - { - Uri endpoint = new Uri(""); - ListPetToysResponse client = new MixApiVersionClient(endpoint).GetListPetToysResponseClient(apiVersion: "2022-11-30-preview"); - - await foreach (BinaryData item in client.GetPetsAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("petId").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - } - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_Pets.cs b/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_Pets.cs deleted file mode 100644 index 0b9d13a7cfd..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_Pets.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace MixApiVersion.Samples -{ - public partial class Samples_Pets - { - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Pet_Delete_ShortVersion() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - - Response response = client.Delete(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Pet_Delete_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - - Response response = await client.DeleteAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Pet_Delete_AllParameters() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - - Response response = client.Delete(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Pet_Delete_AllParameters_Async() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-11-30-preview"); - - Response response = await client.DeleteAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Pets_Read_ShortVersion() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - - Response response = client.Read(1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Pets_Read_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - - Response response = await client.ReadAsync(1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Pets_Read_AllParameters() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - - Response response = client.Read(1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("tag").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Pets_Read_AllParameters_Async() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(); - - Response response = await client.ReadAsync(1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("tag").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Pets_Create_ShortVersion() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - - using RequestContent content = RequestContent.Create(new - { - age = 1234, - }); - Response response = client.Create(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Pets_Create_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - - using RequestContent content = RequestContent.Create(new - { - age = 1234, - }); - Response response = await client.CreateAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Pets_Create_AllParameters() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - - using RequestContent content = RequestContent.Create(new - { - tag = "", - age = 1234, - }); - Response response = client.Create(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("tag").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Pets_Create_AllParameters_Async() - { - Uri endpoint = new Uri(""); - Pets client = new MixApiVersionClient(endpoint).GetPetsClient(apiVersion: "2022-07-09"); - - using RequestContent content = RequestContent.Create(new - { - tag = "", - age = 1234, - }); - Response response = await client.CreateAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("tag").ToString()); - Console.WriteLine(result.GetProperty("age").ToString()); - } - } -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/tests/MixApiVersion.Tests.csproj b/test/TestProjects/MixAPIVersion-TypeSpec/tests/MixApiVersion.Tests.csproj deleted file mode 100644 index 91440f05ca7..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/tests/MixApiVersion.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - $(RequiredTargetFrameworks) - - $(NoWarn);CS1591 - - - - - - - - - - - - - - diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/tspCodeModel.json b/test/TestProjects/MixAPIVersion-TypeSpec/tspCodeModel.json deleted file mode 100644 index fee8dca265e..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/tspCodeModel.json +++ /dev/null @@ -1,852 +0,0 @@ -{ - "$id": "1", - "Name": "MixApiVersion", - "ApiVersions": [ - "2022-11-30-preview" - ], - "Enums": [ - { - "$id": "2", - "kind": "enum", - "name": "Versions", - "crossLanguageDefinitionId": "MixApiVersion.Versions", - "valueType": { - "$id": "3", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "4", - "kind": "enumvalue", - "name": "2022-11-30-preview", - "value": "2022-11-30-preview", - "valueType": { - "$id": "5", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "2" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "ApiVersionEnum", - "decorators": [] - } - ], - "Models": [ - { - "$id": "6", - "kind": "model", - "name": "Toy", - "crossLanguageDefinitionId": "MixApiVersion.Toy", - "usage": "Json", - "decorators": [], - "properties": [ - { - "$id": "7", - "kind": "property", - "name": "id", - "serializedName": "id", - "type": { - "$id": "8", - "kind": "int64", - "name": "int64", - "crossLanguageDefinitionId": "TypeSpec.int64", - "decorators": [] - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Toy.id" - }, - { - "$id": "9", - "kind": "property", - "name": "petId", - "serializedName": "petId", - "type": { - "$id": "10", - "kind": "int64", - "name": "int64", - "crossLanguageDefinitionId": "TypeSpec.int64", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Toy.petId" - }, - { - "$id": "11", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "12", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Toy.name" - } - ] - }, - { - "$id": "13", - "kind": "model", - "name": "Pet", - "crossLanguageDefinitionId": "MixApiVersion.Pet", - "usage": "Json", - "description": "Pet", - "decorators": [], - "properties": [ - { - "$id": "14", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "pet name", - "type": { - "$id": "15", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Pet.name" - }, - { - "$id": "16", - "kind": "property", - "name": "tag", - "serializedName": "tag", - "type": { - "$id": "17", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Pet.tag" - }, - { - "$id": "18", - "kind": "property", - "name": "age", - "serializedName": "age", - "type": { - "$id": "19", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Pet.age" - } - ] - }, - { - "$id": "20", - "kind": "model", - "name": "Error", - "crossLanguageDefinitionId": "MixApiVersion.Error", - "usage": "Error,Json", - "description": "Error", - "decorators": [], - "properties": [ - { - "$id": "21", - "kind": "property", - "name": "code", - "serializedName": "code", - "type": { - "$id": "22", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Error.code" - }, - { - "$id": "23", - "kind": "property", - "name": "message", - "serializedName": "message", - "type": { - "$id": "24", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "MixApiVersion.Error.message" - } - ] - }, - { - "$id": "25", - "kind": "model", - "name": "PagedToy", - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", - "usage": "Json", - "description": "Paged collection of Toy items", - "decorators": [], - "properties": [ - { - "$id": "26", - "kind": "property", - "name": "value", - "serializedName": "value", - "description": "The Toy items on this page", - "type": { - "$id": "27", - "kind": "array", - "name": "ArrayToy", - "valueType": { - "$ref": "6" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" - }, - { - "$id": "28", - "kind": "property", - "name": "nextLink", - "serializedName": "nextLink", - "description": "The link to the next page of items", - "type": { - "$id": "29", - "kind": "url", - "name": "ResourceLocation", - "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", - "baseType": { - "$id": "30", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" - } - ] - } - ], - "Clients": [ - { - "$id": "31", - "Name": "MixApiVersionClient", - "Description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "Operations": [], - "Protocol": { - "$id": "32" - }, - "Parameters": [ - { - "$id": "33", - "Name": "petStoreUrl", - "NameInRequest": "petStoreUrl", - "Type": { - "$id": "34", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "35", - "Name": "Pets", - "Description": "Manage your pets.", - "Operations": [ - { - "$id": "36", - "Name": "delete", - "ResourceName": "Pet", - "Summary": "delete.", - "Description": "Delete a pet.", - "Accessibility": "public", - "Parameters": [ - { - "$id": "37", - "Name": "petStoreUrl", - "NameInRequest": "petStoreUrl", - "Type": { - "$id": "38", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - }, - { - "$id": "39", - "Name": "apiVersion", - "NameInRequest": "api-version", - "Description": "The API version to use for this operation.", - "Type": { - "$id": "40", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Query", - "IsApiVersion": true, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Client", - "DefaultValue": { - "$id": "41", - "Type": { - "$id": "42", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "2022-11-30-preview" - }, - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "43", - "Name": "name", - "NameInRequest": "name", - "Description": "pet name", - "Type": { - "$id": "44", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "45", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "46", - "kind": "constant", - "valueType": { - "$id": "47", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "48", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "DELETE", - "RequestBodyMediaType": "None", - "Uri": "{petStoreUrl}", - "Path": "/pets/Pet/{name}", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "MixApiVersion.Pets.delete", - "Decorators": [] - }, - { - "$id": "49", - "Name": "read", - "ResourceName": "Pets", - "Description": "Returns a pet. Supports eTags.", - "Accessibility": "public", - "Parameters": [ - { - "$ref": "37" - }, - { - "$id": "50", - "Name": "petId", - "NameInRequest": "petId", - "Description": "The id of pet.", - "Type": { - "$id": "51", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "52", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "53", - "kind": "constant", - "valueType": { - "$id": "54", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "55", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "13" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json" - ] - }, - { - "$id": "56", - "StatusCodes": [ - 304 - ], - "BodyType": { - "$ref": "13" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{petStoreUrl}", - "Path": "/pets/{petId}", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "MixApiVersion.Pets.read", - "Decorators": [] - }, - { - "$id": "57", - "Name": "create", - "ResourceName": "Pets", - "Accessibility": "public", - "Parameters": [ - { - "$ref": "37" - }, - { - "$id": "58", - "Name": "apiVersion", - "NameInRequest": "apiVersion", - "Type": { - "$id": "59", - "kind": "constant", - "valueType": { - "$id": "60", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "2022-07-09", - "decorators": [] - }, - "Location": "Query", - "IsApiVersion": true, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "61", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "62", - "kind": "constant", - "valueType": { - "$id": "63", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "64", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "65", - "kind": "constant", - "valueType": { - "$id": "66", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "67", - "Name": "pet", - "NameInRequest": "pet", - "Type": { - "$ref": "13" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "68", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "13" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{petStoreUrl}", - "Path": "/pets", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "MixApiVersion.Pets.create", - "Decorators": [] - } - ], - "Protocol": { - "$id": "69" - }, - "Parent": "MixApiVersionClient", - "Parameters": [ - { - "$ref": "37" - } - ], - "Decorators": [] - }, - { - "$id": "70", - "Name": "ListPetToysResponse", - "Operations": [ - { - "$id": "71", - "Name": "listPet", - "ResourceName": "Toy", - "Summary": "Gets ledger entries from a collection corresponding to a range.", - "Description": "A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.", - "Accessibility": "public", - "Parameters": [ - { - "$id": "72", - "Name": "petStoreUrl", - "NameInRequest": "petStoreUrl", - "Type": { - "$id": "73", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - }, - { - "$id": "74", - "Name": "apiVersion", - "NameInRequest": "api-version", - "Description": "The API version to use for this operation.", - "Type": { - "$id": "75", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Query", - "IsApiVersion": true, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Client", - "DefaultValue": { - "$id": "76", - "Type": { - "$id": "77", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "2022-11-30-preview" - }, - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "78", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "79", - "kind": "constant", - "valueType": { - "$id": "80", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "81", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "25" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{petStoreUrl}", - "Path": "/pets/toys/Toy", - "BufferResponse": true, - "Paging": { - "$id": "82", - "ItemName": "value", - "NextLinkName": "nextLink" - }, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "MixApiVersion.ListPetToysResponse.listPet", - "Decorators": [] - } - ], - "Protocol": { - "$id": "83" - }, - "Parent": "MixApiVersionClient", - "Parameters": [ - { - "$ref": "72" - } - ], - "Decorators": [] - } - ] -} diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/tspconfig.yaml b/test/TestProjects/MixAPIVersion-TypeSpec/tspconfig.yaml deleted file mode 100644 index 986013cdbd4..00000000000 --- a/test/TestProjects/MixAPIVersion-TypeSpec/tspconfig.yaml +++ /dev/null @@ -1,4 +0,0 @@ -options: - "@azure-tools/typespec-csharp": - flavor: "azure" - generate-convenience-methods: false