Skip to content

Commit

Permalink
generate (#5090)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgallan authored Sep 27, 2024
1 parent 52f9cda commit 2ebc3ed
Show file tree
Hide file tree
Showing 25 changed files with 2,396 additions and 0 deletions.
1 change: 1 addition & 0 deletions eng/testProjects.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"special-headers/conditional-request",
"special-headers/repeatability",
"special-words",
"parameters/basic",
"parameters/collection-format",
"parameters/spread",
"parameters/body-optionality",
Expand Down
4 changes: 4 additions & 0 deletions src/AutoRest.CSharp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,10 @@
"commandName": "Project",
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjectsNonAzure\\type\\union\\src\\Generated -n"
},
"typespec-parameters/basic": {
"commandName": "Project",
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\parameters\\basic\\src\\Generated -n"
},
"typespec-parameters/body-optionality": {
"commandName": "Project",
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\parameters\\body-optionality\\src\\Generated -n"
Expand Down
32 changes: 32 additions & 0 deletions test/CadlRanchProjects.Tests/parameter-basic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoRest.TestServer.Tests.Infrastructure;
using Azure;
using Azure.Core;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using Parameters.Basic;
using Parameters.Basic.Models;

namespace CadlRanchProjects.Tests
{
public class parameter_basic : CadlRanchTestBase
{
[Test]
public Task Parameters_Basic_ExplicitBody() => Test(async (host) =>
{
Response response = await new BasicClient(host, null).GetExplicitBodyClient().SimpleAsync(new User("foo"));
Assert.AreEqual(204, response.Status);
});

[Test]
public Task Parameters_Basic_implicitBody() => Test(async (host) =>
{
Response response = await new BasicClient(host, null).GetImplicitBodyClient().SimpleAsync("foo");
Assert.AreEqual(204, response.Status);
});
}
}
11 changes: 11 additions & 0 deletions test/CadlRanchProjects/parameters/basic/Configuration.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions test/CadlRanchProjects/parameters/basic/Parameters.Basic.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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}") = "Parameters.Basic", "src\Parameters.Basic.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Parameters.Basic.Tests", "tests\Parameters.Basic.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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<members>
<member name="SimpleAsync(User,CancellationToken)">
<example>
This sample shows how to call SimpleAsync.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
User body = new User("<name>");
Response response = await client.SimpleAsync(body);
]]></code>
This sample shows how to call SimpleAsync with all parameters.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
User body = new User("<name>");
Response response = await client.SimpleAsync(body);
]]></code></example>
</member>
<member name="Simple(User,CancellationToken)">
<example>
This sample shows how to call Simple.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
User body = new User("<name>");
Response response = client.Simple(body);
]]></code>
This sample shows how to call Simple with all parameters.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
User body = new User("<name>");
Response response = client.Simple(body);
]]></code></example>
</member>
<member name="SimpleAsync(RequestContent,RequestContext)">
<example>
This sample shows how to call SimpleAsync.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = await client.SimpleAsync(content);
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call SimpleAsync with all request content.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = await client.SimpleAsync(content);
Console.WriteLine(response.Status);
]]></code></example>
</member>
<member name="Simple(RequestContent,RequestContext)">
<example>
This sample shows how to call Simple.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = client.Simple(content);
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call Simple with all request content.
<code><![CDATA[
ExplicitBody client = new BasicClient().GetExplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = client.Simple(content);
Console.WriteLine(response.Status);
]]></code></example>
</member>
</members>
</doc>
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<members>
<member name="SimpleAsync(string,CancellationToken)">
<example>
This sample shows how to call SimpleAsync.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
Response response = await client.SimpleAsync("<name>");
]]></code>
This sample shows how to call SimpleAsync with all parameters.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
Response response = await client.SimpleAsync("<name>");
]]></code></example>
</member>
<member name="Simple(string,CancellationToken)">
<example>
This sample shows how to call Simple.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
Response response = client.Simple("<name>");
]]></code>
This sample shows how to call Simple with all parameters.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
Response response = client.Simple("<name>");
]]></code></example>
</member>
<member name="SimpleAsync(RequestContent,RequestContext)">
<example>
This sample shows how to call SimpleAsync.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = await client.SimpleAsync(content);
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call SimpleAsync with all request content.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = await client.SimpleAsync(content);
Console.WriteLine(response.Status);
]]></code></example>
</member>
<member name="Simple(RequestContent,RequestContext)">
<example>
This sample shows how to call Simple.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = client.Simple(content);
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call Simple with all request content.
<code><![CDATA[
ImplicitBody client = new BasicClient().GetImplicitBodyClient();
using RequestContent content = RequestContent.Create(new
{
name = "<name>",
});
Response response = client.Simple(content);
Console.WriteLine(response.Status);
]]></code></example>
</member>
</members>
</doc>
Loading

0 comments on commit 2ebc3ed

Please sign in to comment.