public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DirectConnect.Model.CreateBGPPeerRequest();


            // populate NewBGPPeer
            var requestNewBGPPeerIsNull = true;

            request.NewBGPPeer = new Amazon.DirectConnect.Model.NewBGPPeer();
            Amazon.DirectConnect.AddressFamily requestNewBGPPeer_newBGPPeer_AddressFamily = null;
            if (cmdletContext.NewBGPPeer_AddressFamily != null)
            {
                requestNewBGPPeer_newBGPPeer_AddressFamily = cmdletContext.NewBGPPeer_AddressFamily;
            }
            if (requestNewBGPPeer_newBGPPeer_AddressFamily != null)
            {
                request.NewBGPPeer.AddressFamily = requestNewBGPPeer_newBGPPeer_AddressFamily;
                requestNewBGPPeerIsNull          = false;
            }
            System.String requestNewBGPPeer_newBGPPeer_AmazonAddress = null;
            if (cmdletContext.NewBGPPeer_AmazonAddress != null)
            {
                requestNewBGPPeer_newBGPPeer_AmazonAddress = cmdletContext.NewBGPPeer_AmazonAddress;
            }
            if (requestNewBGPPeer_newBGPPeer_AmazonAddress != null)
            {
                request.NewBGPPeer.AmazonAddress = requestNewBGPPeer_newBGPPeer_AmazonAddress;
                requestNewBGPPeerIsNull          = false;
            }
            System.Int32?requestNewBGPPeer_newBGPPeer_Asn = null;
            if (cmdletContext.NewBGPPeer_Asn != null)
            {
                requestNewBGPPeer_newBGPPeer_Asn = cmdletContext.NewBGPPeer_Asn.Value;
            }
            if (requestNewBGPPeer_newBGPPeer_Asn != null)
            {
                request.NewBGPPeer.Asn  = requestNewBGPPeer_newBGPPeer_Asn.Value;
                requestNewBGPPeerIsNull = false;
            }
            System.String requestNewBGPPeer_newBGPPeer_AuthKey = null;
            if (cmdletContext.NewBGPPeer_AuthKey != null)
            {
                requestNewBGPPeer_newBGPPeer_AuthKey = cmdletContext.NewBGPPeer_AuthKey;
            }
            if (requestNewBGPPeer_newBGPPeer_AuthKey != null)
            {
                request.NewBGPPeer.AuthKey = requestNewBGPPeer_newBGPPeer_AuthKey;
                requestNewBGPPeerIsNull    = false;
            }
            System.String requestNewBGPPeer_newBGPPeer_CustomerAddress = null;
            if (cmdletContext.NewBGPPeer_CustomerAddress != null)
            {
                requestNewBGPPeer_newBGPPeer_CustomerAddress = cmdletContext.NewBGPPeer_CustomerAddress;
            }
            if (requestNewBGPPeer_newBGPPeer_CustomerAddress != null)
            {
                request.NewBGPPeer.CustomerAddress = requestNewBGPPeer_newBGPPeer_CustomerAddress;
                requestNewBGPPeerIsNull            = false;
            }
            // determine if request.NewBGPPeer should be set to null
            if (requestNewBGPPeerIsNull)
            {
                request.NewBGPPeer = null;
            }
            if (cmdletContext.VirtualInterfaceId != null)
            {
                request.VirtualInterfaceId = cmdletContext.VirtualInterfaceId;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DirectConnect.Model.CreateTransitVirtualInterfaceRequest();

            if (cmdletContext.ConnectionId != null)
            {
                request.ConnectionId = cmdletContext.ConnectionId;
            }

            // populate NewTransitVirtualInterface
            var requestNewTransitVirtualInterfaceIsNull = true;

            request.NewTransitVirtualInterface = new Amazon.DirectConnect.Model.NewTransitVirtualInterface();
            Amazon.DirectConnect.AddressFamily requestNewTransitVirtualInterface_newTransitVirtualInterface_AddressFamily = null;
            if (cmdletContext.NewTransitVirtualInterface_AddressFamily != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_AddressFamily = cmdletContext.NewTransitVirtualInterface_AddressFamily;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_AddressFamily != null)
            {
                request.NewTransitVirtualInterface.AddressFamily = requestNewTransitVirtualInterface_newTransitVirtualInterface_AddressFamily;
                requestNewTransitVirtualInterfaceIsNull          = false;
            }
            System.String requestNewTransitVirtualInterface_newTransitVirtualInterface_AmazonAddress = null;
            if (cmdletContext.NewTransitVirtualInterface_AmazonAddress != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_AmazonAddress = cmdletContext.NewTransitVirtualInterface_AmazonAddress;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_AmazonAddress != null)
            {
                request.NewTransitVirtualInterface.AmazonAddress = requestNewTransitVirtualInterface_newTransitVirtualInterface_AmazonAddress;
                requestNewTransitVirtualInterfaceIsNull          = false;
            }
            System.Int32?requestNewTransitVirtualInterface_newTransitVirtualInterface_Asn = null;
            if (cmdletContext.NewTransitVirtualInterface_Asn != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_Asn = cmdletContext.NewTransitVirtualInterface_Asn.Value;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_Asn != null)
            {
                request.NewTransitVirtualInterface.Asn  = requestNewTransitVirtualInterface_newTransitVirtualInterface_Asn.Value;
                requestNewTransitVirtualInterfaceIsNull = false;
            }
            System.String requestNewTransitVirtualInterface_newTransitVirtualInterface_AuthKey = null;
            if (cmdletContext.NewTransitVirtualInterface_AuthKey != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_AuthKey = cmdletContext.NewTransitVirtualInterface_AuthKey;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_AuthKey != null)
            {
                request.NewTransitVirtualInterface.AuthKey = requestNewTransitVirtualInterface_newTransitVirtualInterface_AuthKey;
                requestNewTransitVirtualInterfaceIsNull    = false;
            }
            System.String requestNewTransitVirtualInterface_newTransitVirtualInterface_CustomerAddress = null;
            if (cmdletContext.NewTransitVirtualInterface_CustomerAddress != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_CustomerAddress = cmdletContext.NewTransitVirtualInterface_CustomerAddress;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_CustomerAddress != null)
            {
                request.NewTransitVirtualInterface.CustomerAddress = requestNewTransitVirtualInterface_newTransitVirtualInterface_CustomerAddress;
                requestNewTransitVirtualInterfaceIsNull            = false;
            }
            System.String requestNewTransitVirtualInterface_newTransitVirtualInterface_DirectConnectGatewayId = null;
            if (cmdletContext.NewTransitVirtualInterface_DirectConnectGatewayId != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_DirectConnectGatewayId = cmdletContext.NewTransitVirtualInterface_DirectConnectGatewayId;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_DirectConnectGatewayId != null)
            {
                request.NewTransitVirtualInterface.DirectConnectGatewayId = requestNewTransitVirtualInterface_newTransitVirtualInterface_DirectConnectGatewayId;
                requestNewTransitVirtualInterfaceIsNull = false;
            }
            System.Int32?requestNewTransitVirtualInterface_newTransitVirtualInterface_Mtu = null;
            if (cmdletContext.NewTransitVirtualInterface_Mtu != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_Mtu = cmdletContext.NewTransitVirtualInterface_Mtu.Value;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_Mtu != null)
            {
                request.NewTransitVirtualInterface.Mtu  = requestNewTransitVirtualInterface_newTransitVirtualInterface_Mtu.Value;
                requestNewTransitVirtualInterfaceIsNull = false;
            }
            List <Amazon.DirectConnect.Model.Tag> requestNewTransitVirtualInterface_newTransitVirtualInterface_Tag = null;

            if (cmdletContext.NewTransitVirtualInterface_Tag != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_Tag = cmdletContext.NewTransitVirtualInterface_Tag;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_Tag != null)
            {
                request.NewTransitVirtualInterface.Tags = requestNewTransitVirtualInterface_newTransitVirtualInterface_Tag;
                requestNewTransitVirtualInterfaceIsNull = false;
            }
            System.String requestNewTransitVirtualInterface_newTransitVirtualInterface_VirtualInterfaceName = null;
            if (cmdletContext.NewTransitVirtualInterface_VirtualInterfaceName != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_VirtualInterfaceName = cmdletContext.NewTransitVirtualInterface_VirtualInterfaceName;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_VirtualInterfaceName != null)
            {
                request.NewTransitVirtualInterface.VirtualInterfaceName = requestNewTransitVirtualInterface_newTransitVirtualInterface_VirtualInterfaceName;
                requestNewTransitVirtualInterfaceIsNull = false;
            }
            System.Int32?requestNewTransitVirtualInterface_newTransitVirtualInterface_Vlan = null;
            if (cmdletContext.NewTransitVirtualInterface_Vlan != null)
            {
                requestNewTransitVirtualInterface_newTransitVirtualInterface_Vlan = cmdletContext.NewTransitVirtualInterface_Vlan.Value;
            }
            if (requestNewTransitVirtualInterface_newTransitVirtualInterface_Vlan != null)
            {
                request.NewTransitVirtualInterface.Vlan = requestNewTransitVirtualInterface_newTransitVirtualInterface_Vlan.Value;
                requestNewTransitVirtualInterfaceIsNull = false;
            }
            // determine if request.NewTransitVirtualInterface should be set to null
            if (requestNewTransitVirtualInterfaceIsNull)
            {
                request.NewTransitVirtualInterface = null;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }