Skip to content

Commit af80651

Browse files
CopilotArcturusZhangCopilot
authored
[Azure Mgmt Generator] Add XML documentation for resource client and resource collection client with TODO placeholders for parent resource info (#51861)
Co-authored-by: ArcturusZhang <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Dapeng Zhang <[email protected]>
1 parent cc86bc7 commit af80651

File tree

10 files changed

+15
-8
lines changed

10 files changed

+15
-8
lines changed

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/ResourceClientProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ private ResourceClientProvider(string resourceName, InputModelType model, Resour
8686

8787
protected override string BuildName() => ResourceName.EndsWith("Resource") ? ResourceName : $"{ResourceName}Resource";
8888

89+
// TODO: Add support for getting parent resource from a resource
90+
protected override FormattableString BuildDescription() => $"A class representing a {ResourceName} along with the instance operations that can be performed on it. If you have a {typeof(ResourceIdentifier):C} you can construct a {Type:C} from an instance of {typeof(ArmClient):C} using the GetResource method. Otherwise you can get one from its parent resource (TODO: add parent resource information).";
91+
8992
private OperationSourceProvider? _source;
9093
internal OperationSourceProvider Source => _source ??= new OperationSourceProvider(this);
9194

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/ResourceCollectionClientProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Azure.Generator.Management.Utilities;
1111
using Azure.ResourceManager;
1212
using Azure.ResourceManager.Resources;
13+
using Humanizer;
1314
using Microsoft.TypeSpec.Generator.Input;
1415
using Microsoft.TypeSpec.Generator.Input.Extensions;
1516
using Microsoft.TypeSpec.Generator.Primitives;
@@ -109,6 +110,9 @@ private static void InitializeMethods(
109110

110111
protected override string BuildName() => $"{ResourceName}Collection";
111112

113+
// TODO: Add support for getting parent resource from a resource collection
114+
protected override FormattableString BuildDescription() => $"A class representing a collection of {_resource.Type:C} and their operations. Each {_resource.Type:C} in the collection will belong to the same instance of a parent resource (TODO: add parent resource information). To get a {Type:C} instance call the Get{ResourceName.Pluralize()} method from an instance of the parent resource.";
115+
112116
protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs");
113117

114118
protected override CSharpType? BuildBaseType() => typeof(ArmCollection);

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/BarCollection.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/BarResource.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/BarSettingsResource.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/FooCollection.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/FooResource.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/FooSettingsResource.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/ZooCollection.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/ZooResource.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)