//
// Copyright (c) Microsoft and contributors.  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.
//

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using Microsoft.Azure.Commands.Compute.Automation.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Compute.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute.Automation
{
    [Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VmssIpTagConfig", SupportsShouldProcess = true)]
    [OutputType(typeof(VirtualMachineScaleSetIpTag))]
    public partial class NewAzureRmVmssIpTagConfigCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
    {
        [Parameter(
            Mandatory = true,
            Position = 0,
            ValueFromPipelineByPropertyName = true)]
        [PSArgumentCompleter("FirstPartyUsage", "NetworkDomain")]
        public string IpTagType { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public string Tag { get; set; }

        protected override void ProcessRecord()
        {
            Run();
        }

        private void Run()
        {
            var vIpTags = new VirtualMachineScaleSetIpTag();

            vIpTags.IpTagType = this.MyInvocation.BoundParameters.ContainsKey("IpTagType") ? this.IpTagType : null;
            vIpTags.Tag = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag : null;

            WriteObject(vIpTags);
        }
    }
}
