Skip to content

Commit a88b066

Browse files
committed
Update doc strings
1 parent 697f5cc commit a88b066

File tree

41 files changed

+710
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+710
-76
lines changed

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlDatabaseAuditingPolicy.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2323
[Cmdlet(VerbsCommon.Get, "AzureSqlDatabaseAuditingPolicy"), OutputType(typeof(DatabaseAuditingPolicyModel))]
2424
public class GetAzureSqlDatabaseAuditingPolicy : SqlDatabaseAuditingCmdletBase
2525
{
26+
/// <summary>
27+
/// No sending is needed as this is a Get cmdlet
28+
/// </summary>
29+
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
2630
protected override void SendModel(DatabaseAuditingPolicyModel model)
2731
{
2832
}
2933
}
30-
}
34+
}

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/GetAzureSqlDatabaseServerAuditingPolicy.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2323
[Cmdlet(VerbsCommon.Get, "AzureSqlDatabaseServerAuditingPolicy"), OutputType(typeof(ServerAuditingPolicyModel))]
2424
public class GetAzureSqlDatabaseServerAuditingPolicy : SqlDatabaseServerAuditingCmdletBase
2525
{
26+
/// <summary>
27+
/// No sending is needed as this is a Get cmdlet
28+
/// </summary>
29+
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
2630
protected override void SendModel(ServerAuditingPolicyModel model)
2731
{
2832
}
2933
}
30-
}
34+
}

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseAuditing.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,38 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2323
[Cmdlet(VerbsCommon.Remove, "AzureSqlDatabaseAuditing"), OutputType(typeof(DatabaseAuditingPolicyModel))]
2424
public class RemoveSqlDatabaseAuditing : SqlDatabaseAuditingCmdletBase
2525
{
26-
26+
/// <summary>
27+
/// Defines whether the cmdlets will output the model object at the end of its execution
28+
/// </summary>
2729
[Parameter(Mandatory = false)]
2830
public SwitchParameter PassThru { get; set; }
2931

32+
/// <summary>
33+
/// Returns true if the model object that was constructed by this cmdlet should be written out
34+
/// </summary>
35+
/// <returns>True if the model object should be written out, False otherwise</returns>
3036
protected override bool WriteResult() { return PassThru; }
3137

38+
/// <summary>
39+
/// Updates the given model element with the cmdlet specific operation
40+
/// </summary>
41+
/// <param name="model">A model object</param>
3242
protected override DatabaseAuditingPolicyModel UpdateModel(DatabaseAuditingPolicyModel model)
3343
{
3444
base.UpdateModel(model);
3545
model.AuditState = AuditStateType.Disabled;
3646
return model;
3747
}
3848

49+
/// <summary>
50+
/// This method is responsible to call the right API in the communication layer that will eventually send the information in the
51+
/// object to the REST endpoint
52+
/// </summary>
53+
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
3954
protected override void SendModel(DatabaseAuditingPolicyModel model)
4055
{
4156
ModelAdapter.IgnoreStorage = true;
4257
base.SendModel(model);
4358
}
4459
}
45-
}
60+
}

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/RemoveSqlDatabaseServerAuditing.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,38 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2323
[Cmdlet(VerbsCommon.Remove, "AzureSqlDatabaseServerAuditing"), OutputType(typeof(ServerAuditingPolicyModel))]
2424
public class RemoveSqlDatabaseServerAuditing : SqlDatabaseServerAuditingCmdletBase
2525
{
26-
26+
/// <summary>
27+
/// Defines whether the cmdlets will output the model object at the end of its execution
28+
/// </summary>
2729
[Parameter(Mandatory = false)]
2830
public SwitchParameter PassThru { get; set; }
2931

32+
/// <summary>
33+
/// Returns true if the model object that was constructed by this cmdlet should be written out
34+
/// </summary>
35+
/// <returns>True if the model object should be written out, False otherwise</returns>
3036
protected override bool WriteResult() { return PassThru; }
3137

38+
/// <summary>
39+
/// Updates the given model element with the cmdlet specific operation
40+
/// </summary>
41+
/// <param name="model">A model object</param>
3242
protected override ServerAuditingPolicyModel UpdateModel(ServerAuditingPolicyModel model)
3343
{
3444
base.UpdateModel(model);
3545
model.AuditState = AuditStateType.Disabled;
3646
return model;
3747
}
48+
49+
/// <summary>
50+
/// This method is responsible to call the right API in the communication layer that will eventually send the information in the
51+
/// object to the REST endpoint
52+
/// </summary>
53+
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
3854
protected override void SendModel(ServerAuditingPolicyModel model)
3955
{
4056
ModelAdapter.IgnoreStorage = true;
4157
base.SendModel(model);
4258
}
4359
}
44-
}
60+
}

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlDatabaseAuditingPolicy.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2828
[Cmdlet(VerbsCommon.Set, "AzureSqlDatabaseAuditingPolicy"), OutputType(typeof(DatabaseAuditingPolicyModel))]
2929
public class SetAzureSqlDatabaseAuditingPolicy : SqlDatabaseAuditingCmdletBase
3030
{
31-
31+
/// <summary>
32+
/// Defines whether the cmdlets will output the model object at the end of its execution
33+
/// </summary>
3234
[Parameter(Mandatory = false)]
3335
public SwitchParameter PassThru { get; set; }
3436

@@ -54,8 +56,16 @@ public class SetAzureSqlDatabaseAuditingPolicy : SqlDatabaseAuditingCmdletBase
5456
[ValidateNotNullOrEmpty]
5557
public string StorageKeyType { get; set; }
5658

59+
/// <summary>
60+
/// Returns true if the model object that was constructed by this cmdlet should be written out
61+
/// </summary>
62+
/// <returns>True if the model object should be written out, False otherwise</returns>
5763
protected override bool WriteResult() { return PassThru; }
5864

65+
/// <summary>
66+
/// Updates the given model element with the cmdlet specific operation
67+
/// </summary>
68+
/// <param name="model">A model object</param>
5969
protected override DatabaseAuditingPolicyModel UpdateModel(DatabaseAuditingPolicyModel model)
6070
{
6171
base.UpdateModel(model);
@@ -86,6 +96,9 @@ protected override DatabaseAuditingPolicyModel UpdateModel(DatabaseAuditingPolic
8696
return model;
8797
}
8898

99+
/// <summary>
100+
/// In cases where the user decided to use one of the shortcuts (ALL or NONE), this method sets the value of the EventType property to reflect the correct values
101+
/// </summary>
89102
private void ProcessShortcuts()
90103
{
91104
if(EventType == null || EventType.Length == 0)
@@ -117,6 +130,4 @@ private void ProcessShortcuts()
117130
}
118131
}
119132
}
120-
121-
122-
}
133+
}

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SetAzureSqlDatabaseServerAuditingPolicy.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@ public class SetAzureSqlDatabaseServerAuditingPolicy : SqlDatabaseServerAuditing
5454
[ValidateNotNullOrEmpty]
5555
public string StorageKeyType { get; set; }
5656

57+
/// <summary>
58+
/// Returns true if the model object that was constructed by this cmdlet should be written out
59+
/// </summary>
60+
/// <returns>True if the model object should be written out, False otherwise</returns>
5761
protected override bool WriteResult() { return PassThru; }
5862

63+
/// <summary>
64+
/// Updates the given model element with the cmdlet specific operation
65+
/// </summary>
66+
/// <param name="model">A model object</param>
5967
protected override ServerAuditingPolicyModel UpdateModel(ServerAuditingPolicyModel model)
6068
{
6169
base.UpdateModel(model);
@@ -84,6 +92,9 @@ protected override ServerAuditingPolicyModel UpdateModel(ServerAuditingPolicyMod
8492
return model;
8593
}
8694

95+
/// <summary>
96+
/// In cases where the user decided to use one of the shortcuts (ALL or NONE), this method sets the value of the EventType property to reflect the correct values
97+
/// </summary>
8798
private void ProcessShortcuts()
8899
{
89100
if (EventType == null)
@@ -114,4 +125,4 @@ private void ProcessShortcuts()
114125
}
115126
}
116127
}
117-
}
128+
}

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SqlDatabaseAuditingCmdletBase.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2323
/// </summary>
2424
public abstract class SqlDatabaseAuditingCmdletBase : SqlDatabaseCmdletBase<DatabaseAuditingPolicyModel, SqlAuditAdapter>
2525
{
26-
2726
/// <summary>
2827
/// Provides the model element that this cmdlet operates on
2928
/// </summary>
@@ -33,11 +32,21 @@ protected override DatabaseAuditingPolicyModel GetModel()
3332
return ModelAdapter.GetDatabaseAuditingPolicy(ResourceGroupName, ServerName, DatabaseName, clientRequestId);
3433
}
3534

35+
/// <summary>
36+
/// Creation and initialization of the ModelAdapter object
37+
/// </summary>
38+
/// <param name="subscription">The AzureSubscription in which the current execution is performed</param>
39+
/// <returns>An initialized and ready to use ModelAdapter object</returns>
3640
protected override SqlAuditAdapter InitModelAdapter(AzureSubscription subscription)
3741
{
3842
return new SqlAuditAdapter(Profile, subscription);
3943
}
4044

45+
/// <summary>
46+
/// This method is responsible to call the right API in the communication layer that will eventually send the information in the
47+
/// object to the REST endpoint
48+
/// </summary>
49+
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
4150
protected override void SendModel(DatabaseAuditingPolicyModel model)
4251
{
4352
ModelAdapter.SetDatabaseAuditingPolicy(model, clientRequestId);

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/SqlDatabaseServerAuditingCmdletBase.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2020
{
2121
/// <summary>
22-
/// The base class for all au Management Cmdlets
22+
/// The base class for all SQL server auditing Management Cmdlets
2323
/// </summary>
2424
public abstract class SqlDatabaseServerAuditingCmdletBase : SqlCmdletBase<ServerAuditingPolicyModel, SqlAuditAdapter>
2525
{
26-
2726
/// <summary>
2827
/// Provides the model element that this cmdlet operates on
2928
/// </summary>
@@ -33,11 +32,21 @@ protected override ServerAuditingPolicyModel GetModel()
3332
return ModelAdapter.GetServerAuditingPolicy(ResourceGroupName, ServerName, this.clientRequestId);
3433
}
3534

35+
/// <summary>
36+
/// Creation and initialization of the ModelAdapter object
37+
/// </summary>
38+
/// <param name="subscription">The AzureSubscription in which the current execution is performed</param>
39+
/// <returns>An initialized and ready to use ModelAdapter object</returns>
3640
protected override SqlAuditAdapter InitModelAdapter(AzureSubscription subscription)
3741
{
3842
return new SqlAuditAdapter(Profile, subscription);
3943
}
4044

45+
/// <summary>
46+
/// This method is responsible to call the right API in the communication layer that will eventually send the information in the
47+
/// object to the REST endpoint
48+
/// </summary>
49+
/// <param name="model">The model object with the data to be sent to the REST endpoints</param>
4150
protected override void SendModel(ServerAuditingPolicyModel model)
4251
{
4352
ModelAdapter.SetServerAuditingPolicy(model, clientRequestId);

src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/Auditing/UseAzureSqlDatabaseServerAuditingPolicy.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,22 @@ namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.Auditing
2525
[Cmdlet(VerbsOther.Use, "AzureSqlDatabaseServerAuditingPolicy"), OutputType(typeof(DatabaseAuditingPolicyModel))]
2626
public class UseAzureSqlDatabaseServerAuditingPolicy : SqlDatabaseAuditingCmdletBase
2727
{
28-
28+
/// <summary>
29+
/// Defines whether the cmdlets will output the model object at the end of its execution
30+
/// </summary>
2931
[Parameter(Mandatory = false)]
3032
public SwitchParameter PassThru { get; set; }
3133

34+
/// <summary>
35+
/// Returns true if the model object that was constructed by this cmdlet should be written out
36+
/// </summary>
37+
/// <returns>True if the model object should be written out, False otherwise</returns>
3238
protected override bool WriteResult() { return PassThru; }
3339

40+
/// <summary>
41+
/// Updates the given model element with the cmdlet specific operation
42+
/// </summary>
43+
/// <param name="model">A model object</param>
3444
protected override DatabaseAuditingPolicyModel UpdateModel(DatabaseAuditingPolicyModel model)
3545
{
3646
base.UpdateModel(model);
@@ -39,6 +49,10 @@ protected override DatabaseAuditingPolicyModel UpdateModel(DatabaseAuditingPolic
3949
return model;
4050
}
4151

52+
/// <summary>
53+
/// Returns the storage account name that is used at the policy of the database's server.
54+
/// </summary>
55+
/// <returns>A storage account name</returns>
4256
protected string GetStorageAccountName()
4357
{
4458
string storageAccountName = this.ModelAdapter.GetServerStorageAccount(this.ResourceGroupName, this.ServerName, this.clientRequestId);

0 commit comments

Comments
 (0)