Skip to content

Commit aa08ecf

Browse files
committed
Fix issue with line endings in AddAzureApiManagementApiToProduct
1 parent 9bd9fbd commit aa08ecf

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
// // Copyright (c) Microsoft. All rights reserved.// // Licensed under the Apache License, Version 2.0 (the "License");// you may not use this file except in compliance with the License.// You may obtain a copy of the License at// http://www.apache.org/licenses/LICENSE-2.0// // Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License.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, Mandatory = true, HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")] [ValidateNotNullOrEmpty] public PsApiManagementContext Context { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing Product to add API to. This parameter is required.")] [ValidateNotNullOrEmpty] public String ProductId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Identifier of existing APIs to be added to the product. This parameter is required.")] [ValidateNotNullOrEmpty] public String ApiId { get; set; } [Parameter( ValueFromPipelineByPropertyName = true, Mandatory = false, 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); } } }}
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
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,
27+
Mandatory = true,
28+
HelpMessage = "Instance of PsApiManagementContext. This parameter is required.")]
29+
[ValidateNotNullOrEmpty]
30+
public PsApiManagementContext Context { get; set; }
31+
32+
[Parameter(
33+
ValueFromPipelineByPropertyName = true,
34+
Mandatory = 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,
41+
Mandatory = 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,
48+
Mandatory = false,
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)