diff --git a/eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/MockableResourceProvider.cs b/eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/MockableResourceProvider.cs index 6cd88a83b6de..6a1c5c1a4edd 100644 --- a/eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/MockableResourceProvider.cs +++ b/eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/MockableResourceProvider.cs @@ -233,10 +233,19 @@ private IEnumerable BuildMethodsForResource(ResourceClientProvid resource.Type, This.As().Client(), BuildSingletonResourceIdentifier(This.As().Id(), resource.ResourceTypeValue, resource.SingletonResourceName!))); - yield return new MethodProvider( + var method = new MethodProvider( resourceMethodSignature, bodyStatement, this); + + // Copy the enhanced XML documentation from the singleton resource's Get method if available + var getMethod = resource.Methods.FirstOrDefault(m => m.Signature.Name == "Get"); + if (getMethod?.XmlDocs?.Summary != null) + { + method.XmlDocs?.Update(summary: getMethod.XmlDocs.Summary); + } + + yield return method; } else { @@ -278,11 +287,19 @@ static MethodProvider BuildGetMethod(TypeProvider enclosingType, MethodProvider [.. pathParameters, .. resourceGetMethod.Signature.Parameters], Attributes: [new AttributeStatement(typeof(ForwardsClientCallsAttribute))]); - return new MethodProvider( + var method = new MethodProvider( signature, // invoke on a MethodSignature would handle the async extra calls and keyword automatically Return(This.Invoke(collectionGetSignature).Invoke(resourceGetMethod.Signature)), enclosingType); + + // Copy the enhanced XML documentation from the collection's Get method + if (resourceGetMethod.XmlDocs?.Summary != null) + { + method.XmlDocs?.Update(summary: resourceGetMethod.XmlDocs.Summary); + } + + return method; } } } diff --git a/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsResourceGroupResource.cs b/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsResourceGroupResource.cs index 6882e4d50d91..5bbb3eeed082 100644 --- a/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsResourceGroupResource.cs +++ b/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsResourceGroupResource.cs @@ -38,7 +38,23 @@ public virtual FooCollection GetFoos() return GetCachedClient(client => new FooCollection(client, Id)); } - /// Get a Foo. + /// + /// Get a Foo + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/foos/{fooName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the Foo. /// The cancellation token to use. /// is null. @@ -51,7 +67,23 @@ public virtual async Task> GetFooAsync(string fooName, Can return await GetFoos().GetAsync(fooName, cancellationToken).ConfigureAwait(false); } - /// Get a Foo. + /// + /// Get a Foo + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/foos/{fooName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the Foo. /// The cancellation token to use. /// is null. @@ -64,7 +96,27 @@ public virtual Response GetFoo(string fooName, CancellationToken ca return GetFoos().Get(fooName, cancellationToken); } - /// Gets an object representing a along with the instance operations that can be performed on it in the . + /// + /// Get a FooSettings + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/FooSettings/default. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// Resource. + /// . + /// + /// + /// /// Returns a object. public virtual FooSettingsResource GetFooSettings() { @@ -78,7 +130,23 @@ public virtual BazCollection GetBazs() return GetCachedClient(client => new BazCollection(client, Id)); } - /// Get a Baz. + /// + /// Get a Baz + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/bazs/{bazName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the Baz. /// The cancellation token to use. /// is null. @@ -91,7 +159,23 @@ public virtual async Task> GetBazAsync(string bazName, Can return await GetBazs().GetAsync(bazName, cancellationToken).ConfigureAwait(false); } - /// Get a Baz. + /// + /// Get a Baz + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/bazs/{bazName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the Baz. /// The cancellation token to use. /// is null. @@ -111,7 +195,23 @@ public virtual ZooCollection GetZoos() return GetCachedClient(client => new ZooCollection(client, Id)); } - /// Get a Zoo. + /// + /// Get a Zoo + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/zoos/{zooName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the Zoo. /// The cancellation token to use. /// is null. @@ -124,7 +224,23 @@ public virtual async Task> GetZooAsync(string zooName, Can return await GetZoos().GetAsync(zooName, cancellationToken).ConfigureAwait(false); } - /// Get a Zoo. + /// + /// Get a Zoo + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/zoos/{zooName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the Zoo. /// The cancellation token to use. /// is null. @@ -144,7 +260,23 @@ public virtual JobResourceCollection GetJobResources() return GetCachedClient(client => new JobResourceCollection(client, Id)); } - /// Gets information about the specified job. + /// + /// Gets information about the specified job. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/jobs/{jobName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the JobResource. /// $expand is supported on details parameter for job, which provides details on the job stages. /// The cancellation token to use. @@ -158,7 +290,23 @@ public virtual async Task> GetJobResourceAsync(string jobN return await GetJobResources().GetAsync(jobName, expand, cancellationToken).ConfigureAwait(false); } - /// Gets information about the specified job. + /// + /// Gets information about the specified job. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/jobs/{jobName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The name of the JobResource. /// $expand is supported on details parameter for job, which provides details on the job stages. /// The cancellation token to use. diff --git a/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsSubscriptionResource.cs b/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsSubscriptionResource.cs index bcb2f54ad931..ced3a2623ae8 100644 --- a/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsSubscriptionResource.cs +++ b/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsSubscriptionResource.cs @@ -66,7 +66,23 @@ public virtual PlaywrightQuotaCollection GetAllPlaywrightQuota(AzureLocation loc return GetCachedClient(client => new PlaywrightQuotaCollection(client, Id, location)); } - /// Get subscription-level location-based Playwright quota resource by name. + /// + /// Get subscription-level location-based Playwright quota resource by name. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/MgmtTypeSpec/locations/{location}/playwrightQuotas/{playwrightQuotaName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The location for the resource. /// The name of the PlaywrightQuota. /// The cancellation token to use. @@ -76,7 +92,23 @@ public virtual async Task> GetPlaywrightQuotaA return await GetAllPlaywrightQuota(location).GetAsync(playwrightQuotaName, cancellationToken).ConfigureAwait(false); } - /// Get subscription-level location-based Playwright quota resource by name. + /// + /// Get subscription-level location-based Playwright quota resource by name. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/MgmtTypeSpec/locations/{location}/playwrightQuotas/{playwrightQuotaName}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The location for the resource. /// The name of the PlaywrightQuota. /// The cancellation token to use. diff --git a/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs b/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs index 72fc2a2fb7f3..23e16577f8a8 100644 --- a/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs +++ b/eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs @@ -47,7 +47,23 @@ public virtual GroupQuotaSubscriptionRequestStatusCollection GetGroupQuotaSubscr return GetCachedClient(client => new GroupQuotaSubscriptionRequestStatusCollection(client, Id, managementGroupId)); } - /// Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals status with the request details and status. + /// + /// Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals status with the request details and status. + /// + /// + /// Request Path. + /// /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/MgmtTypeSpec/quotas/{requestId}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The managementGroupId for the resource. /// The name of the GroupQuotaSubscriptionRequestStatus. /// The cancellation token to use. @@ -61,7 +77,23 @@ public virtual async Task> return await GetGroupQuotaSubscriptionRequestStatuses(managementGroupId).GetAsync(requestId, cancellationToken).ConfigureAwait(false); } - /// Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals status with the request details and status. + /// + /// Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate status. This API provides the finals status with the request details and status. + /// + /// + /// Request Path. + /// /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/MgmtTypeSpec/quotas/{requestId}. + /// + /// + /// Operation Id. + /// Get. + /// + /// + /// Default Api Version. + /// 2024-05-01. + /// + /// + /// /// The managementGroupId for the resource. /// The name of the GroupQuotaSubscriptionRequestStatus. /// The cancellation token to use.