Skip to content

Commit 5117fd0

Browse files
author
REDMOND\yisha
committed
Fixing daviburg's CR comments
1 parent 2cbc975 commit 5117fd0

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

src/ResourceManager/LogicApp/Commands.LogicApp/Cmdlets/IntegrationAccount/GetAzureIntegrationAccountGeneratedIcnCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ public override void ExecuteCmdlet()
7171

7272
if (string.IsNullOrEmpty(AgreementType))
7373
{
74-
this.WriteWarning("By default, you are using the X12 agreement. Please provide a value for AgreementType if you would like to specify the agreement type. Possible values are X12 and Edifact.");
74+
this.WriteWarning(Constants.NoAgreementTypeParameterWarningMessage);
7575
}
7676

7777
this.WriteObject(
7878
sendToPipeline: string.IsNullOrEmpty(this.AgreementName) ?
7979
this.IntegrationAccountClient.ListIntegrationAccountGeneratedIcns(
8080
resourceGroupName: this.ResourceGroupName,
8181
integrationAccountName: this.Name,
82-
agreementType: (AgreementType)Enum.Parse(typeof(AgreementType), AgreementType, true)) as object :
82+
agreementType: (AgreementType)Enum.Parse(enumType: typeof(AgreementType), value: AgreementType, ignoreCase: true)) as object :
8383
this.IntegrationAccountClient.GetIntegrationAccountGeneratedIcn(
8484
resourceGroupName: this.ResourceGroupName,
8585
integrationAccountName: this.Name,

src/ResourceManager/LogicApp/Commands.LogicApp/Cmdlets/IntegrationAccount/GetAzureIntegrationAccountReceivedIcnCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ public override void ExecuteCmdlet()
7777

7878
if (string.IsNullOrEmpty(AgreementType))
7979
{
80-
this.WriteWarning("By default, you are using the X12 agreement. Please provide a value for AgreementType if you would like to specify the agreement type. Possible values are X12 and Edifact.");
80+
this.WriteWarning(Constants.NoAgreementTypeParameterWarningMessage);
8181
}
8282

8383
this.WriteObject(
8484
sendToPipeline: this.IntegrationAccountClient.GetIntegrationAccountReceivedControlNumber(
8585
resourceGroupName: this.ResourceGroupName,
8686
integrationAccountName: this.Name,
8787
integrationAccountAgreementName: this.AgreementName,
88-
agreementType: (AgreementType)Enum.Parse(typeof(AgreementType), AgreementType, true),
88+
agreementType: (AgreementType)Enum.Parse(enumType: typeof(AgreementType), value: AgreementType, ignoreCase: true),
8989
controlNumber: this.ControlNumberValue));
9090
}
9191
}

src/ResourceManager/LogicApp/Commands.LogicApp/Cmdlets/IntegrationAccount/RemoveAzureIntegrationAccountReceivedIcnCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public override void ExecuteCmdlet()
7171

7272
if (string.IsNullOrEmpty(AgreementType))
7373
{
74-
this.WriteWarning("By default, you are using the X12 agreement. Please provide a value for AgreementType if you would like to specify the agreement type. Possible values are X12 and Edifact.");
74+
this.WriteWarning(Constants.NoAgreementTypeParameterWarningMessage);
7575
}
7676

7777
this.ConfirmAction(
@@ -82,7 +82,7 @@ public override void ExecuteCmdlet()
8282
resourceGroupName: this.ResourceGroupName,
8383
integrationAccountName: this.Name,
8484
integrationAccountAgreementName: this.AgreementName,
85-
agreementType: (AgreementType)Enum.Parse(typeof(AgreementType), AgreementType, true),
85+
agreementType: (AgreementType)Enum.Parse(enumType: typeof(AgreementType), value: AgreementType, ignoreCase: true),
8686
controlNumber: this.ControlNumberValue);
8787
});
8888
}

src/ResourceManager/LogicApp/Commands.LogicApp/Cmdlets/IntegrationAccount/UpdateAzureIntegrationAccountGeneratedIcnCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ public override void ExecuteCmdlet()
7777

7878
if (string.IsNullOrEmpty(AgreementType))
7979
{
80-
this.WriteWarning("By default, you are using the X12 agreement. Please provide a value for AgreementType if you would like to specify the agreement type. Possible values are X12 and Edifact.");
80+
this.WriteWarning(Constants.NoAgreementTypeParameterWarningMessage);
8181
}
8282

8383
var integrationAccountGeneratedIcn = this.IntegrationAccountClient.GetIntegrationAccountGeneratedIcn(
8484
resourceGroupName: this.ResourceGroupName,
8585
integrationAccountName: this.Name,
8686
integrationAccountAgreementName: this.AgreementName);
8787

88-
integrationAccountGeneratedIcn.MessageType = (MessageType)Enum.Parse(typeof(MessageType), AgreementType, true);
88+
integrationAccountGeneratedIcn.MessageType = (MessageType)Enum.Parse(enumType: typeof(MessageType), value: AgreementType, ignoreCase: true);
8989
integrationAccountGeneratedIcn.ControlNumber = this.ControlNumber;
9090
integrationAccountGeneratedIcn.ControlNumberChangedTime = DateTime.UtcNow > integrationAccountGeneratedIcn.ControlNumberChangedTime ?
9191
DateTime.UtcNow :

src/ResourceManager/LogicApp/Commands.LogicApp/Cmdlets/IntegrationAccount/UpdateAzureIntegrationAccountReceivedIcnCommand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ public override void ExecuteCmdlet()
8585

8686
if (string.IsNullOrEmpty(AgreementType))
8787
{
88-
this.WriteWarning("By default, you are using the X12 agreement. Please provide a value for AgreementType if you would like to specify the agreement type. Possible values are X12 and Edifact.");
88+
this.WriteWarning(Constants.NoAgreementTypeParameterWarningMessage);
8989
}
9090

9191
var integrationAccountReceivedIcn = this.IntegrationAccountClient.GetIntegrationAccountReceivedControlNumber(
9292
resourceGroupName: this.ResourceGroupName,
9393
integrationAccountName: this.Name,
9494
integrationAccountAgreementName: this.AgreementName,
95-
agreementType: (AgreementType)Enum.Parse(typeof(AgreementType), AgreementType, true),
95+
agreementType: (AgreementType)Enum.Parse(enumType: typeof(AgreementType), value: AgreementType, ignoreCase: true),
9696
controlNumber: this.ControlNumberValue);
9797

98-
integrationAccountReceivedIcn.MessageType = (MessageType)Enum.Parse(typeof(MessageType), AgreementType, true);
98+
integrationAccountReceivedIcn.MessageType = (MessageType)Enum.Parse(enumType: typeof(MessageType), value: AgreementType, ignoreCase: true);
9999
integrationAccountReceivedIcn.ControlNumber = this.ControlNumberValue;
100100
integrationAccountReceivedIcn.IsMessageProcessingFailed = this.IsMessageProcessingFailed;
101101
integrationAccountReceivedIcn.ControlNumberChangedTime = DateTime.UtcNow > integrationAccountReceivedIcn.ControlNumberChangedTime ?
@@ -112,7 +112,7 @@ public override void ExecuteCmdlet()
112112
resourceGroupName: this.ResourceGroupName,
113113
integrationAccountName: this.Name,
114114
integrationAccountAgreementName: this.AgreementName,
115-
agreementType: (AgreementType)Enum.Parse(typeof(AgreementType), AgreementType, true),
115+
agreementType: (AgreementType)Enum.Parse(enumType: typeof(AgreementType), value: AgreementType, ignoreCase: true),
116116
integrationAccountControlNumber: integrationAccountReceivedIcn),
117117
enumerateCollection: true);
118118
});

src/ResourceManager/LogicApp/Commands.LogicApp/Utilities/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ public class Constants
4444
/// Suffix in session id to represent is acknowledgement message
4545
/// </summary>
4646
public const string IsAcknowledgementSessionIdSuffix = "-ACK";
47+
48+
public const string NoAgreementTypeParameterWarningMessage = "By default, you are using the X12 agreement type. Please provide a value for AgreementType if you would like to specify the agreement type. Possible values are X12 and Edifact.";
4749
}
4850
}

0 commit comments

Comments
 (0)