private Amazon.DirectConnect.Model.CreateTransitVirtualInterfaceResponse CallAWSServiceOperation(IAmazonDirectConnect client, Amazon.DirectConnect.Model.CreateTransitVirtualInterfaceRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Direct Connect", "CreateTransitVirtualInterface");
     try
     {
         #if DESKTOP
         return(client.CreateTransitVirtualInterface(request));
         #elif CORECLR
         return(client.CreateTransitVirtualInterfaceAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        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);
        }