Skip to content

Commit

Permalink
Fix Az.Resources XML Comments (#18486)
Browse files Browse the repository at this point in the history
* Fix Az.Resources XML Comments

* Fix Az.Resources XML COmments

* Fix Az.Resources XML Comments

Co-authored-by: Ziyue Zheng <v-ziyzhe@microsoft.com>
  • Loading branch information
v-yuzhichen and ziyuezh576 authored Jun 22, 2022
1 parent c47851d commit ab6a762
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/Resources/ResourceManager/Components/ApiVersionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ internal static class ApiVersionHelper
/// <param name="resourceId">The resource Id.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <param name="pre">When specified, indicates if pre-release API versions should be considered.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header values.</param>
internal static Task<string> DetermineApiVersion(IAzureContext context, string resourceId, CancellationToken cancellationToken, bool? pre = null, Dictionary<string, string> cmdletHeaderValues = null)
{
var providerNamespace = ResourceIdUtility.GetExtensionProviderNamespace(resourceId)
Expand All @@ -65,6 +66,7 @@ internal static Task<string> DetermineApiVersion(IAzureContext context, string r
/// <param name="resourceType">The resource type.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <param name="pre">When specified, indicates if pre-release API versions should be considered.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header values.</param>
internal static Task<string> DetermineApiVersion(IAzureContext context, string providerNamespace, string resourceType, CancellationToken cancellationToken, bool? pre = null, Dictionary<string, string> cmdletHeaderValues = null)
{
var cacheKey = ApiVersionCache.GetCacheKey(context.Environment.Name, providerNamespace: providerNamespace, resourceType: resourceType);
Expand Down Expand Up @@ -106,6 +108,7 @@ internal static Task<string> DetermineApiVersion(IAzureContext context, string p
/// <param name="providerNamespace">The provider namespace.</param>
/// <param name="resourceType">The resource type.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header values.</param>
private static string[] GetApiVersionsForResourceType(IAzureContext context, string providerNamespace, string resourceType, CancellationToken cancellationToken, Dictionary<string, string> cmdletHeaderValues = null)
{
var resourceManagerClient = ResourceManagerClientHelper.GetResourceManagerClient(context, cmdletHeaderValues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public abstract class HttpClientHelper
/// </summary>
/// <param name="credentials">The service client credentials.</param>
/// <param name="headerValues">The header values.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header values.</param>
protected HttpClientHelper(ServiceClientCredentials credentials, IEnumerable<ProductInfoHeaderValue> headerValues, Dictionary<string, string> cmdletHeaderValues)
{
this.credentials = credentials;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ protected HttpClientHelperFactory()
/// </summary>
/// <param name="credentials">The credentials.</param>
/// <param name="headerValues">The headers.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header.</param>
public virtual HttpClientHelper CreateHttpClientHelper(ServiceClientCredentials credentials, IEnumerable<ProductInfoHeaderValue> headerValues, Dictionary<string, string> cmdletHeaderValues)
{
return new HttpClientHelperImpl(credentials: credentials, headerValues: headerValues, cmdletHeaderValues: cmdletHeaderValues);
Expand All @@ -63,6 +64,7 @@ private class HttpClientHelperImpl : HttpClientHelper
/// </summary>
/// <param name="credentials">The credentials.</param>
/// <param name="headerValues">The headers.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header.</param>
public HttpClientHelperImpl(ServiceClientCredentials credentials, IEnumerable<ProductInfoHeaderValue> headerValues, Dictionary<string, string> cmdletHeaderValues)
: base(credentials: credentials, headerValues: headerValues, cmdletHeaderValues: cmdletHeaderValues)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public static class QueryFilterBuilder
/// <param name="tagName">The tag name.</param>
/// <param name="tagValue">The tag value.</param>
/// <param name="filter">The filter.</param>
/// <param name="nameContains"></param>
/// <param name="resourceGroupNameContains"></param>
public static string CreateFilter(
string subscriptionId,
string resourceGroup,
Expand Down
5 changes: 2 additions & 3 deletions src/Resources/ResourceManager/Components/ResourceIdUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public static class ResourceIdUtility
/// Processes the parameters to return a valid resource Id.
/// </summary>
/// <param name="resourceId">The resource Id.</param>
/// <param name="resourceGroupName">The resource group</param>
/// <param name="extensionResourceType">The extension resource type string in the format: '{providerName}/{typeName}/{nestedTypeName}'</param>
/// <param name="extensionResourceName">The extension resource name in the format: '{resourceName}[/{nestedResourceName}]'</param>
public static string GetResourceId(string resourceId, string extensionResourceType, string extensionResourceName = null)
Expand Down Expand Up @@ -357,7 +356,7 @@ public static (string scope, string relativeResourceId) SplitResourceId(string f
}

/// <summary>
/// Gets either a resource type or resource Id based on the value of the <see cref="getResourceName"/> parameter.
/// Gets either a resource type or resource Id based on the value of the <paramref name="getResourceName"/> parameter.
/// </summary>
/// <param name="resourceId">The resource Id.</param>
/// <param name="getResourceName">When set to true returns a resource name, otherwise a resource type.</param>
Expand All @@ -381,7 +380,7 @@ private static bool IsExtensionResourceId(string resourceId)
}

/// <summary>
/// Gets either a resource type or resource Id based on the value of the <see cref="getResourceName"/> parameter.
/// Gets either a resource type or resource Id based on the value of the <paramref name="getResourceName"/> parameter.
/// </summary>
/// <param name="resourceId">The resource Id.</param>
/// <param name="getResourceName">When set to true returns a resource name, otherwise a resource type.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ internal static class ResourceManagerClientHelper
/// Gets a new instance of the <see cref="ResourceManagerRestRestClient"/>.
/// </summary>
/// <param name="context">The azure profile.</param>
/// <param name="cmdletHeaderValues">The cmdlet info header values.</param>
internal static ResourceManagerRestRestClient GetResourceManagerClient(IAzureContext context, Dictionary<string, string> cmdletHeaderValues = null)
{
var endpoint = context.Environment.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ public static void Unpack(
/// Gets all of the deployment resource JObjects within the specified template
/// JObject.
/// </summary>
/// <param name="templateObj"></param>
/// <param name="includeNested">If true, deployment resource objects from nested
/// templates will be included in the results</param>
/// <remarks>
Expand Down Expand Up @@ -336,6 +337,7 @@ private static JObject[] GetDeploymentResourceObjects(JObject templateObj, bool
/// Gets all of the TemplateLink JObjects within the specified template object that
/// are representing references to Template Spec artifacts.
/// </summary>
/// <param name="templateObj"></param>
/// <param name="includeNested">If true, template links from nested templates
/// will be included in the results</param>
/// <remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ internal static ErrorRecord ToErrorRecord(this Exception exception)
/// <summary>
/// Converts <see cref="AggregateException"/> objects into <see cref="ErrorRecord"/>
/// </summary>
/// <param name="exception">The exception</param>
internal static ErrorRecord ToErrorRecord(this AggregateException aggregateException)
{
// TODO: Improve this.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Extensions
using System.Management.Automation;

/// <summary>
/// A helper class that handles common tasks that deal with the <see cref="ResourcePropertyObject"/> class.
/// A helper class that handles common tasks that deal with the <see cref="PSObject"/> class.
/// </summary>
public static class PsObjectExtensions
{
Expand All @@ -46,9 +46,9 @@ public static class PsObjectExtensions
};

/// <summary>
/// Converts a <see cref="ResourcePropertyObject"/> to <see cref="JToken"/>
/// Converts a <see cref="PSObject"/> to <see cref="JToken"/>
/// </summary>
/// <param name="propertyObject">The <see cref="ResourcePropertyObject"/></param>
/// <param name="propertyObject">The ResourcePropertyObject.</param>
internal static JToken ToResourcePropertiesBody(this PSObject propertyObject)
{
return PsObjectExtensions.ToJToken(propertyObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class CmdletInfoHandler : DelegatingHandler
/// <summary>
/// Initializes a new instance of the <see cref="CmdletInfoHandler" /> class.
/// </summary>
/// <param name="headerValues">The product info to add as headers.</param>
/// <param name="cmdletHeaderValues">The product info to add as headers.</param>
public CmdletInfoHandler(Dictionary<string, string> cmdletHeaderValues)
{
this.cmdletHeaderValues = cmdletHeaderValues;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class UnregisterAzureProviderPreviewFeatureCmdlet : ProviderFeatureCmdlet
[ValidateNotNullOrEmpty]
public string ProviderNamespace { get; set; }

[Parameter(Mandatory = false)]
/// <summary>
/// Gets or sets the pass thru.
/// </summary>
[Parameter(Mandatory = false)]
public SwitchParameter PassThru { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ protected Task<ResponseWithContinuation<TType[]>> GetNextLink<TType>(string next
/// <summary>
/// Converts the resource object to specified resource type object.
/// </summary>
/// <param name="resourceType">The resource type.</param>
/// <param name="resources">The policy definition resource object.</param>
protected PSObject[] GetOutputObjects(string resourceType, params JToken[] resources)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public enum ListFilter
/// <summary>
/// Converts the resource object collection to a PsPolicyAssignment collection.
/// </summary>
/// <param name="resourceType">The resource type of the objects to create</param>
/// <param name="resources">The policy definition resource object.</param>
protected PsPolicyAssignment[] GetOutputPolicyAssignments(params JToken[] resources)
{
Expand Down Expand Up @@ -107,7 +106,6 @@ protected PsPolicySetDefinition[] GetOutputPolicySetDefinitions(params JToken[]
/// <summary>
/// Converts the resource object collection to a PsPolicyExemption collection.
/// </summary>
/// <param name="resourceType">The resource type of the objects to create</param>
/// <param name="resources">The policy definition resource object.</param>
protected PsPolicyExemption[] GetOutputPolicyExemptions(params JToken[] resources)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ public virtual PSWhatIfOperationResult ExecuteDeploymentWhatIf(PSDeploymentWhatI
/// Executes deployment What-If at the specified scope.
/// </summary>
/// <param name="parameters"></param>
/// <param name="excludeChangeTypeNames"></param>
/// <returns></returns>
public virtual PSWhatIfOperationResult ExecuteDeploymentWhatIf(PSDeploymentWhatIfCmdletParameters parameters, string[] excludeChangeTypeNames)
{
Expand Down Expand Up @@ -1673,7 +1674,6 @@ private void CancelDeploymentAtResourceGroup(List<PSDeployment> deployments, str
/// Validates a given deployment.
/// </summary>
/// <param name="parameters">The deployment create options</param>
/// <param name="deploymentMode">The deployment mode</param>
/// <returns>The validation errors if there's any, or empty list otherwise.</returns>
public virtual List<PSResourceManagerError> ValidateDeployment(PSDeploymentCmdletParameters parameters)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void DeleteTemplateSpec(
/// <remarks>
/// Method name is protected and has an 'Internal' suffix because the return type is
/// the SDK model rather than the model wrapped for PS. See
/// <see cref="CreateOrUpdateTemplateSpec(string, string, string, string, string)"/>
/// <see cref="CreateOrUpdateTemplateSpec"/>
/// for the method that returns the wrapped model.
/// </remarks>
protected TemplateSpec CreateOrUpdateTemplateSpecInternal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public PSRoleDefinition GetRoleDefinition(string roleId)
/// Gets a single role definition by the role Id guid.
/// </summary>
/// <param name="roleId">RoleId guid</param>
/// <param name="scope">The scope of the role definition</param>
public PSRoleDefinition GetRoleDefinition(Guid roleId, string scope)
{
return AuthorizationManagementClient.RoleDefinitions.Get(scope, roleId.ToString()).ToPSRoleDefinition();
Expand All @@ -72,6 +73,9 @@ public PSRoleDefinition GetRoleDefinition(Guid roleId, string scope)
/// Otherwise will fetch Roledefinitions with provided name
/// </summary>
/// <param name="name">The role name</param>
/// <param name="scope">The scope of the role definition</param>
/// <param name="first"></param>
/// <param name="skip"></param>
/// <returns>The matched role Definitions</returns>
public IEnumerable<PSRoleDefinition> FilterRoleDefinitions(string name, string scope, ulong first = ulong.MaxValue, ulong skip = 0)
{
Expand Down Expand Up @@ -125,6 +129,7 @@ public IEnumerable<PSRoleDefinition> FilterRoleDefinitionsByCustom(string scope,
/// Creates new role assignment.
/// </summary>
/// <param name="parameters">The create parameters</param>
/// <param name="roleAssignmentId">The name of the role assignment. It can be any valid GUID.</param>
/// <returns>The created role assignment object</returns>
public PSRoleAssignment CreateRoleAssignment(FilterRoleAssignmentsOptions parameters, Guid roleAssignmentId = default(Guid))
{
Expand Down Expand Up @@ -173,6 +178,8 @@ public IEnumerable<PSRoleDefinition> FilterRoleDefinitionsByCustom(string scope,
/// </summary>
/// <param name="options">The filtering options</param>
/// <param name="currentSubscription">The current subscription</param>
/// <param name="first"></param>
/// <param name="skip"></param>
/// <returns>The filtered role assignments</returns>
public List<PSRoleAssignment> FilterRoleAssignments(FilterRoleAssignmentsOptions options, string currentSubscription, ulong first = ulong.MaxValue, ulong skip = 0)
{
Expand Down Expand Up @@ -382,7 +389,7 @@ public PSRoleDefinition GetSingleRoleDefinitionByName(string name, string scope)
/// Deletes a role definition based on the id.
/// </summary>
/// <param name="roleDefinitionId">The role definition id to delete</param>
/// <param name="subscriptionId">Current subscription id</param>
/// <param name="scope">The scope of the role definition</param>
/// <returns>The deleted role definition.</returns>
public PSRoleDefinition RemoveRoleDefinition(Guid roleDefinitionId, string scope)
{
Expand All @@ -401,6 +408,7 @@ public PSRoleDefinition RemoveRoleDefinition(Guid roleDefinitionId, string scope
/// Deletes a role definition based on the name.
/// </summary>
/// <param name="roleDefinitionName">The role definition name.</param>
/// <param name="scope">The scope of the role definition</param>
/// <returns>The deleted role definition.</returns>
public PSRoleDefinition RemoveRoleDefinition(string roleDefinitionName, string scope)
{
Expand Down Expand Up @@ -467,6 +475,7 @@ public PSRoleDefinition UpdateRoleDefinition(PSRoleDefinition roleDefinition)
/// Creates a new role definition.
/// </summary>
/// <param name="roleDefinition">The role definition to create.</param>
/// <param name="roleDefinitionId">The role definition id to create.</param>
/// <returns>The created role definition.</returns>
public PSRoleDefinition CreateRoleDefinition(PSRoleDefinition roleDefinition, Guid roleDefinitionId = default(Guid))
{
Expand Down

0 comments on commit ab6a762

Please sign in to comment.