Skip to content

Commit 2606722

Browse files
authored
Merge pull request #3599 from cormacpayne/release-3.7.0
Fix line ending issue in ApiManagement cmdlet
2 parents 54732ec + aa08ecf commit 2606722

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/AddAzureApiManagementApiToProduct.cs

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,51 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands{ using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models; using System; using System.Management.Automation; [Cmdlet(VerbsCommon.Add, Constants.ApiManagementApiToProduct)] [OutputType(typeof(bool))] public class AddAzureApiManagementApiToProduct : AzureApiManagementCmdletBase { [Parameter( ValueFromPipelineByPropertyName = true,
15+
namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
16+
{
17+
using Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models;
18+
using System;
19+
using System.Management.Automation;
20+
21+
[Cmdlet(VerbsCommon.Add, Constants.ApiManagementApiToProduct)]
22+
[OutputType(typeof(bool))]
23+
public class AddAzureApiManagementApiToProduct : AzureApiManagementCmdletBase
24+
{
25+
[Parameter(
26+
ValueFromPipelineByPropertyName = true,
1627
Mandatory = true,
17-
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] [ValidateNotNullOrEmpty] public PsApiManagementContext Context { get; set; } [Parameter( ValueFromPipelineByPropertyName = true,
28+
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")]
29+
[ValidateNotNullOrEmpty]
30+
public PsApiManagementContext Context { get; set; }
31+
32+
[Parameter(
33+
ValueFromPipelineByPropertyName = true,
1834
Mandatory = true,
19-
HelpMessage = "Identifier of existing Product to add API to. This parameter is required.")] [ValidateNotNullOrEmpty] public String ProductId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true,
35+
HelpMessage = "Identifier of existing Product to add API to. This parameter is required.")]
36+
[ValidateNotNullOrEmpty]
37+
public String ProductId { get; set; }
38+
39+
[Parameter(
40+
ValueFromPipelineByPropertyName = true,
2041
Mandatory = true,
21-
HelpMessage = "Identifier of existing APIs to be added to the product. This parameter is required.")] [ValidateNotNullOrEmpty] public String ApiId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true,
42+
HelpMessage = "Identifier of existing APIs to be added to the product. This parameter is required.")]
43+
[ValidateNotNullOrEmpty]
44+
public String ApiId { get; set; }
45+
46+
[Parameter(
47+
ValueFromPipelineByPropertyName = true,
2248
Mandatory = false,
23-
HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] public SwitchParameter PassThru { get; set; } public override void ExecuteApiManagementCmdlet() { Client.ApiAddToProduct(Context, ProductId, ApiId); if (PassThru) { WriteObject(true); } } }}
49+
HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")]
50+
public SwitchParameter PassThru { get; set; }
51+
52+
public override void ExecuteApiManagementCmdlet()
53+
{
54+
Client.ApiAddToProduct(Context, ProductId, ApiId);
55+
56+
if (PassThru)
57+
{
58+
WriteObject(true);
59+
}
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)