Skip to content

Commit 7b238d3

Browse files
author
dragonfly91
committed
[RS Backup] Fixing 7349803 (documentation fixes) for some files in Helper Layer
1 parent 1a1941b commit 7b238d3

File tree

5 files changed

+82
-4
lines changed

5 files changed

+82
-4
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/JobConversions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static void AddServiceClientJobsToPSList(JobListResponse serviceClientJob
8282
#region AzureVm job private helpers
8383

8484
/// <summary>
85-
/// Helper function to convert ps auzre vm backup policy job from service response.
85+
/// Helper function to convert ps azure vm backup policy job from service response.
8686
/// </summary>
8787
private static CmdletModel.AzureVmJob GetPSAzureVmJob(JobResource serviceClientJob)
8888
{
@@ -154,7 +154,7 @@ private static CmdletModel.AzureVmJob GetPSAzureVmJob(JobResource serviceClientJ
154154
}
155155

156156
/// <summary>
157-
/// Helper function to convert ps auzre vm backup job error info from service response.
157+
/// Helper function to convert ps azure vm backup job error info from service response.
158158
/// </summary>
159159
private static CmdletModel.AzureVmJobErrorInfo GetPSAzureVmErrorInfo(AzureIaaSVMErrorInfo serviceClientError)
160160
{
@@ -187,7 +187,7 @@ public static string GetLastIdFromFullId(string fullId)
187187

188188

189189
/// <summary>
190-
/// Helper function to get job type from ps backupmanagement type.
190+
/// Helper function to get job type from ps backup management type.
191191
/// </summary>
192192
public static string GetJobTypeForService(CmdletModel.BackupManagementType mgmtType)
193193
{

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/SchedulePolicyConversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static List<DateTime> ParseDateTimesToUTC(IList<DateTime> localTimes)
8484
}
8585

8686
// <summary>
87-
/// Helper function to convert service simple schedule policy from ps scheduel policy.
87+
/// Helper function to convert service simple schedule policy from ps schedule policy.
8888
/// </summary>
8989
public static ServiceClientModel.SimpleSchedulePolicy GetServiceClientSimpleSchedulePolicy(
9090
SimpleSchedulePolicy psPolicy)

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/HelperUtils.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@
2323

2424
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
2525
{
26+
/// <summary>
27+
/// Utilities used by the helpers.
28+
/// </summary>
2629
public class HelperUtils
2730
{
31+
/// <summary>
32+
/// Gets list of enums of type T given the corresponding list of string equivalents.
33+
/// This method parses each of the strings and converts them into enums.
34+
/// </summary>
35+
/// <typeparam name="T">Type of the enum into which each string in the input list is to be type casted</typeparam>
36+
/// <param name="strList">List of strings</param>
37+
/// <returns></returns>
2838
public static List<T> GetEnumListFromStringList<T>(IList<string> strList)
2939
{
3040
if (strList == null || strList.Count == 0)
@@ -41,6 +51,12 @@ public static List<T> GetEnumListFromStringList<T>(IList<string> strList)
4151
return ret;
4252
}
4353

54+
/// <summary>
55+
/// Gets list of string equivalents given the corresponding list of enums of type T.
56+
/// </summary>
57+
/// <typeparam name="T">Type of the enum whose list should be converted to list of strings</typeparam>
58+
/// <param name="enumList">List of enums</param>
59+
/// <returns></returns>
4460
public static List<string> GetStringListFromEnumList<T>(IList<T> enumList)
4561
{
4662
if (enumList == null || enumList.Count == 0)
@@ -97,6 +113,12 @@ public static List<string> GetStringListFromEnumList<T>(IList<T> enumList)
97113
return keyValuePairDict;
98114
}
99115

116+
/// <summary>
117+
/// Gets container URI from the provided dictionary of key value pairs.
118+
/// </summary>
119+
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
120+
/// <param name="id">ID of the resource</param>
121+
/// <returns></returns>
100122
public static string GetContainerUri(
101123
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
102124
string id
@@ -116,6 +138,12 @@ string id
116138
return containerUri;
117139
}
118140

141+
/// <summary>
142+
/// Gets protected item URI from the provided dictionary of key value pairs.
143+
/// </summary>
144+
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
145+
/// <param name="id">ID of the resource</param>
146+
/// <returns></returns>
119147
public static string GetProtectedItemUri(
120148
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
121149
string id
@@ -135,6 +163,12 @@ string id
135163
return itemUri;
136164
}
137165

166+
/// <summary>
167+
/// Gets protectable item URI from the provided dictionary of key value pairs.
168+
/// </summary>
169+
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
170+
/// <param name="id">ID of the resource</param>
171+
/// <returns></returns>
138172
public static string GetProtectableItemUri(
139173
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
140174
string id
@@ -154,6 +188,12 @@ string id
154188
return protectableItemUri;
155189
}
156190

191+
/// <summary>
192+
/// Gets polcy name from the provided dictionary of key value pairs.
193+
/// </summary>
194+
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
195+
/// <param name="id">ID of the resource</param>
196+
/// <returns></returns>
157197
public static string GetPolicyNameFromPolicyId(
158198
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
159199
string id

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/ServiceClientHelpers.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,25 @@
2020

2121
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
2222
{
23+
/// <summary>
24+
/// Constants used by the service client helpers.
25+
/// </summary>
2326
public class ServiceClientConstants
2427
{
2528
public const string SkipToken = "skipToken";
2629
}
2730

31+
/// <summary>
32+
/// Helper methods used by the service client adapter.
33+
/// </summary>
2834
public class ServiceClientHelpers
2935
{
36+
/// <summary>
37+
/// Gets the provider type with which the service client calls are to made to contact the backend service.
38+
/// This can be determined by the container type in case of certain containers such as those of the type AzureVM.
39+
/// </summary>
40+
/// <param name="containerType">Type of the container</param>
41+
/// <returns></returns>
3042
public static string GetServiceClientProviderType(CmdletModel.ContainerType containerType)
3143
{
3244
string providerType = string.Empty;
@@ -43,6 +55,12 @@ public static string GetServiceClientProviderType(CmdletModel.ContainerType cont
4355
return providerType;
4456
}
4557

58+
/// <summary>
59+
/// Gets the provider type with which the service client calls are to made to contact the backend service.
60+
/// This is determined by the workload type in case of certain containers such as those of the type AzureVM.
61+
/// </summary>
62+
/// <param name="workloadType"></param>
63+
/// <returns></returns>
4664
public static string GetServiceClientProviderType(CmdletModel.WorkloadType workloadType)
4765
{
4866
string providerType = string.Empty;
@@ -59,6 +77,13 @@ public static string GetServiceClientProviderType(CmdletModel.WorkloadType workl
5977
return providerType;
6078
}
6179

80+
/// <summary>
81+
/// Gets the skip token from the next link. Usually, next link is the location uri returned as a header
82+
/// when an ARM call is made. When this skip token (if non-null) is used in the next call to the backend service,
83+
/// the next set of objects are returned.
84+
/// </summary>
85+
/// <param name="nextLink">The next link a.k.a location url</param>
86+
/// <param name="skipToken">The skip token extracted from the next link</param>
6287
public static void GetSkipTokenFromNextLink(string nextLink, out string skipToken)
6388
{
6489
if (nextLink != null)
@@ -98,6 +123,11 @@ public static string GetLastIdFromFullId(string fullId)
98123
return splitArr[splitArr.Length - 1];
99124
}
100125

126+
/// <summary>
127+
/// Gets the service client specific container type given the PS container type
128+
/// </summary>
129+
/// <param name="containerType">PS container type</param>
130+
/// <returns></returns>
101131
public static string GetServiceClientContainerType(CmdletModel.ContainerType containerType)
102132
{
103133
string serviceClientContainerType = string.Empty;
@@ -114,6 +144,11 @@ public static string GetServiceClientContainerType(CmdletModel.ContainerType con
114144
return serviceClientContainerType;
115145
}
116146

147+
/// <summary>
148+
/// Gets the service client specific workload type given the PS workload type
149+
/// </summary>
150+
/// <param name="workloadType"></param>
151+
/// <returns></returns>
117152
public static string GetServiceClientWorkloadType(CmdletModel.WorkloadType workloadType)
118153
{
119154
string serviceClientWorkloadType = string.Empty;

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Validations/PolicyValidations.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
2424
{
25+
/// <summary>
26+
/// Backup policy validation helpers.
27+
/// </summary>
2528
public partial class PolicyHelpers
2629
{
2730
// <summary>

0 commit comments

Comments
 (0)