Skip to content

Commit

Permalink
update version of MGC to adopt new typespec version 0.63.0 (#47602)
Browse files Browse the repository at this point in the history
* update version of MGC to adopt new typespec version

* regen
  • Loading branch information
ArcturusZhang authored Dec 18, 2024
1 parent bc680a9 commit 6fe23e5
Show file tree
Hide file tree
Showing 6 changed files with 241 additions and 219 deletions.
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
</ItemGroup>

<ItemGroup Condition="'$(IsGeneratorLibrary)' == 'true'">
<PackageReference Update="Microsoft.Generator.CSharp.ClientModel" Version="1.0.0-alpha.20241215.1" />
<PackageReference Update="Microsoft.Generator.CSharp.ClientModel" Version="1.0.0-alpha.20241217.2" />
</ItemGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ public static class EnumMember
{
public static InputEnumTypeValue Int32(string name, int value)
{
return new InputEnumTypeValue(name, value, InputPrimitiveType.Int32, $"{name} description");
return new InputEnumTypeValue(name, value, InputPrimitiveType.Int32, null, $"{name} description");
}

public static InputEnumTypeValue Float32(string name, float value)
{
return new InputEnumTypeValue(name, value, InputPrimitiveType.Float32, $"{name} description");
return new InputEnumTypeValue(name, value, InputPrimitiveType.Float32, null, $"{name} description");
}

public static InputEnumTypeValue String(string name, string value)
{
return new InputEnumTypeValue(name, value, InputPrimitiveType.String, $"{name} description");
return new InputEnumTypeValue(name, value, InputPrimitiveType.String, null, $"{name} description");
}
}

Expand Down Expand Up @@ -87,6 +87,7 @@ public static InputParameter Parameter(
return new InputParameter(
name,
nameInRequest ?? name,
null,
$"{name} description",
type,
location,
Expand Down Expand Up @@ -127,10 +128,11 @@ public static InputEnumType Enum(
name,
access,
null,
null,
$"{name} description",
usage,
underlyingType,
values is null ? [new InputEnumTypeValue("Value", 1, InputPrimitiveType.Int32, "Value description")] : [.. values],
values is null ? [new InputEnumTypeValue("Value", 1, InputPrimitiveType.Int32, null, "Value description")] : [.. values],
isExtensible);
}

Expand All @@ -141,11 +143,13 @@ public static InputModelProperty Property(
bool isReadOnly = false,
bool isDiscriminator = false,
string? wireName = null,
string? summary = null,
string? description = null)
{
return new InputModelProperty(
name,
wireName ?? name,
summary,
description ?? $"Description for {name}",
type,
isRequired,
Expand All @@ -171,6 +175,7 @@ public static InputModelType Model(
name,
access,
null,
null,
$"{name} description",
usage,
[.. propertiesList],
Expand Down Expand Up @@ -208,6 +213,7 @@ public static InputOperation Operation(
return new InputOperation(
name,
null,
null,
$"{name} description",
null,
access,
Expand Down Expand Up @@ -242,6 +248,7 @@ public static InputClient Client(string name, IEnumerable<InputOperation>? opera
{
return new InputClient(
name,
null,
$"{name} description",
operations is null ? [] : [.. operations],
parameters is null ? [] : [.. parameters],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ internal class ClientProviderTests
private const string KeyAuthCategory = "WithKeyAuth";
private const string OAuth2Category = "WithOAuth2";
private const string TestClientName = "TestClient";
private static readonly InputClient _animalClient = new("animal", "AnimalClient description", [], [], TestClientName);
private static readonly InputClient _dogClient = new("dog", "DogClient description", [], [], _animalClient.Name);
private static readonly InputClient _huskyClient = new("husky", "HuskyClient description", [], [], _dogClient.Name);
private static readonly InputClient _animalClient = new("animal", null, "AnimalClient description", [], [], TestClientName);
private static readonly InputClient _dogClient = new("dog", null, "DogClient description", [], [], _animalClient.Name);
private static readonly InputClient _huskyClient = new("husky", null, "HuskyClient description", [], [], _dogClient.Name);

private bool _containsSubClients;
private bool _hasKeyAuth;
Expand Down
Loading

0 comments on commit 6fe23e5

Please sign in to comment.