Skip to content

Fix line ending issue in ApiManagement cmdlet #3599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,51 @@
// 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,
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,
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,
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,
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); } } }}
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);
}
}
}
}