Container for the parameters to the CreatePrivateVirtualInterface operation. Creates a new private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A private virtual interface supports sending traffic to a single virtual private cloud (VPC).
Inheritance: AmazonDirectConnectRequest
        /// <summary>
        /// Initiates the asynchronous execution of the CreatePrivateVirtualInterface operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface operation on AmazonDirectConnectClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreatePrivateVirtualInterface
        ///         operation.</returns>
        public IAsyncResult BeginCreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreatePrivateVirtualInterfaceRequestMarshaller();
            var unmarshaller = CreatePrivateVirtualInterfaceResponseUnmarshaller.Instance;

            return BeginInvoke<CreatePrivateVirtualInterfaceRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 IAsyncResult invokeCreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest createPrivateVirtualInterfaceRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreatePrivateVirtualInterfaceRequestMarshaller().Marshall(createPrivateVirtualInterfaceRequest);
     var unmarshaller = CreatePrivateVirtualInterfaceResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        /// <summary>
        /// Creates a new private virtual interface. A virtual interface is the VLAN that transports
        /// AWS Direct Connect traffic. A private virtual interface supports sending traffic to
        /// a single virtual private cloud (VPC).
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface service method.</param>
        /// 
        /// <returns>The response from the CreatePrivateVirtualInterface service method, as returned by DirectConnect.</returns>
        /// <exception cref="Amazon.DirectConnect.Model.DirectConnectClientException">
        /// The API was called with invalid parameters. The error message will contain additional
        /// details about the cause.
        /// </exception>
        /// <exception cref="Amazon.DirectConnect.Model.DirectConnectServerException">
        /// A server-side error occurred during the API call. The error message will contain additional
        /// details about the cause.
        /// </exception>
        public CreatePrivateVirtualInterfaceResponse CreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest request)
        {
            var marshaller = new CreatePrivateVirtualInterfaceRequestMarshaller();
            var unmarshaller = CreatePrivateVirtualInterfaceResponseUnmarshaller.Instance;

            return Invoke<CreatePrivateVirtualInterfaceRequest,CreatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the CreatePrivateVirtualInterface operation.
 /// <seealso cref="Amazon.DirectConnect.AmazonDirectConnect.CreatePrivateVirtualInterface"/>
 /// </summary>
 /// 
 /// <param name="createPrivateVirtualInterfaceRequest">Container for the necessary parameters to execute the CreatePrivateVirtualInterface
 ///          operation on AmazonDirectConnect.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking
 ///         EndCreatePrivateVirtualInterface operation.</returns>
 public IAsyncResult BeginCreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest createPrivateVirtualInterfaceRequest, AsyncCallback callback, object state)
 {
     return invokeCreatePrivateVirtualInterface(createPrivateVirtualInterfaceRequest, callback, state, false);
 }
 /// <summary>
 /// <para> Creates a new private virtual interface. A virtual interface is the VLAN that transports Direct Connect traffic. A private virtual
 /// interface supports sending traffic to a single VPC. </para>
 /// </summary>
 /// 
 /// <param name="createPrivateVirtualInterfaceRequest">Container for the necessary parameters to execute the CreatePrivateVirtualInterface
 ///          service method on AmazonDirectConnect.</param>
 /// 
 /// <returns>The response from the CreatePrivateVirtualInterface service method, as returned by AmazonDirectConnect.</returns>
 /// 
 /// <exception cref="DirectConnectServerException"/>
 /// <exception cref="DirectConnectClientException"/>
 public CreatePrivateVirtualInterfaceResponse CreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest createPrivateVirtualInterfaceRequest)
 {
     IAsyncResult asyncResult = invokeCreatePrivateVirtualInterface(createPrivateVirtualInterfaceRequest, null, null, true);
     return EndCreatePrivateVirtualInterface(asyncResult);
 }
        /// <summary>
        /// <para>Creates a new private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A private
        /// virtual interface supports sending traffic to a single Virtual Private Cloud (VPC).</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface
        /// service method on AmazonDirectConnect.</param>
        /// 
        /// <returns>The response from the CreatePrivateVirtualInterface service method, as returned by AmazonDirectConnect.</returns>
        /// 
        /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" />
        /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" />
		public CreatePrivateVirtualInterfaceResponse CreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest request)
        {
            var task = CreatePrivateVirtualInterfaceAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreatePrivateVirtualInterface operation.
        /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.CreatePrivateVirtualInterface"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public Task<CreatePrivateVirtualInterfaceResponse> CreatePrivateVirtualInterfaceAsync(CreatePrivateVirtualInterfaceRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreatePrivateVirtualInterfaceRequestMarshaller();
            var unmarshaller = CreatePrivateVirtualInterfaceResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreatePrivateVirtualInterfaceRequest, CreatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// <para>Creates a new private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A private
        /// virtual interface supports sending traffic to a single Virtual Private Cloud (VPC).</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface
        /// service method on AmazonDirectConnect.</param>
        /// 
        /// <returns>The response from the CreatePrivateVirtualInterface service method, as returned by AmazonDirectConnect.</returns>
        /// 
        /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" />
        /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" />
		public CreatePrivateVirtualInterfaceResponse CreatePrivateVirtualInterface(CreatePrivateVirtualInterfaceRequest request)
        {
            var task = CreatePrivateVirtualInterfaceAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreatePrivateVirtualInterface operation.
        /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<CreatePrivateVirtualInterfaceResponse> CreatePrivateVirtualInterfaceAsync(CreatePrivateVirtualInterfaceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreatePrivateVirtualInterfaceRequestMarshaller();
            var unmarshaller = CreatePrivateVirtualInterfaceResponseUnmarshaller.Instance;

            return InvokeAsync<CreatePrivateVirtualInterfaceRequest,CreatePrivateVirtualInterfaceResponse>(request, marshaller,
                unmarshaller, cancellationToken);
        }
 private Amazon.DirectConnect.Model.CreatePrivateVirtualInterfaceResponse CallAWSServiceOperation(IAmazonDirectConnect client, Amazon.DirectConnect.Model.CreatePrivateVirtualInterfaceRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Direct Connect", "CreatePrivateVirtualInterface");
     try
     {
         #if DESKTOP
         return(client.CreatePrivateVirtualInterface(request));
         #elif CORECLR
         return(client.CreatePrivateVirtualInterfaceAsync(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.CreatePrivateVirtualInterfaceRequest();

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

            // populate NewPrivateVirtualInterface
            var requestNewPrivateVirtualInterfaceIsNull = true;

            request.NewPrivateVirtualInterface = new Amazon.DirectConnect.Model.NewPrivateVirtualInterface();
            Amazon.DirectConnect.AddressFamily requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AddressFamily = null;
            if (cmdletContext.NewPrivateVirtualInterface_AddressFamily != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AddressFamily = cmdletContext.NewPrivateVirtualInterface_AddressFamily;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AddressFamily != null)
            {
                request.NewPrivateVirtualInterface.AddressFamily = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AddressFamily;
                requestNewPrivateVirtualInterfaceIsNull          = false;
            }
            System.String requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AmazonAddress = null;
            if (cmdletContext.NewPrivateVirtualInterface_AmazonAddress != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AmazonAddress = cmdletContext.NewPrivateVirtualInterface_AmazonAddress;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AmazonAddress != null)
            {
                request.NewPrivateVirtualInterface.AmazonAddress = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AmazonAddress;
                requestNewPrivateVirtualInterfaceIsNull          = false;
            }
            System.Int32?requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Asn = null;
            if (cmdletContext.NewPrivateVirtualInterface_Asn != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Asn = cmdletContext.NewPrivateVirtualInterface_Asn.Value;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Asn != null)
            {
                request.NewPrivateVirtualInterface.Asn  = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Asn.Value;
                requestNewPrivateVirtualInterfaceIsNull = false;
            }
            System.String requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AuthKey = null;
            if (cmdletContext.NewPrivateVirtualInterface_AuthKey != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AuthKey = cmdletContext.NewPrivateVirtualInterface_AuthKey;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AuthKey != null)
            {
                request.NewPrivateVirtualInterface.AuthKey = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_AuthKey;
                requestNewPrivateVirtualInterfaceIsNull    = false;
            }
            System.String requestNewPrivateVirtualInterface_newPrivateVirtualInterface_CustomerAddress = null;
            if (cmdletContext.NewPrivateVirtualInterface_CustomerAddress != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_CustomerAddress = cmdletContext.NewPrivateVirtualInterface_CustomerAddress;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_CustomerAddress != null)
            {
                request.NewPrivateVirtualInterface.CustomerAddress = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_CustomerAddress;
                requestNewPrivateVirtualInterfaceIsNull            = false;
            }
            System.String requestNewPrivateVirtualInterface_newPrivateVirtualInterface_DirectConnectGatewayId = null;
            if (cmdletContext.NewPrivateVirtualInterface_DirectConnectGatewayId != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_DirectConnectGatewayId = cmdletContext.NewPrivateVirtualInterface_DirectConnectGatewayId;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_DirectConnectGatewayId != null)
            {
                request.NewPrivateVirtualInterface.DirectConnectGatewayId = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_DirectConnectGatewayId;
                requestNewPrivateVirtualInterfaceIsNull = false;
            }
            System.Int32?requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Mtu = null;
            if (cmdletContext.NewPrivateVirtualInterface_Mtu != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Mtu = cmdletContext.NewPrivateVirtualInterface_Mtu.Value;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Mtu != null)
            {
                request.NewPrivateVirtualInterface.Mtu  = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Mtu.Value;
                requestNewPrivateVirtualInterfaceIsNull = false;
            }
            List <Amazon.DirectConnect.Model.Tag> requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Tag = null;

            if (cmdletContext.NewPrivateVirtualInterface_Tag != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Tag = cmdletContext.NewPrivateVirtualInterface_Tag;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Tag != null)
            {
                request.NewPrivateVirtualInterface.Tags = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Tag;
                requestNewPrivateVirtualInterfaceIsNull = false;
            }
            System.String requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualGatewayId = null;
            if (cmdletContext.NewPrivateVirtualInterface_VirtualGatewayId != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualGatewayId = cmdletContext.NewPrivateVirtualInterface_VirtualGatewayId;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualGatewayId != null)
            {
                request.NewPrivateVirtualInterface.VirtualGatewayId = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualGatewayId;
                requestNewPrivateVirtualInterfaceIsNull             = false;
            }
            System.String requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualInterfaceName = null;
            if (cmdletContext.NewPrivateVirtualInterface_VirtualInterfaceName != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualInterfaceName = cmdletContext.NewPrivateVirtualInterface_VirtualInterfaceName;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualInterfaceName != null)
            {
                request.NewPrivateVirtualInterface.VirtualInterfaceName = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_VirtualInterfaceName;
                requestNewPrivateVirtualInterfaceIsNull = false;
            }
            System.Int32?requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Vlan = null;
            if (cmdletContext.NewPrivateVirtualInterface_Vlan != null)
            {
                requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Vlan = cmdletContext.NewPrivateVirtualInterface_Vlan.Value;
            }
            if (requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Vlan != null)
            {
                request.NewPrivateVirtualInterface.Vlan = requestNewPrivateVirtualInterface_newPrivateVirtualInterface_Vlan.Value;
                requestNewPrivateVirtualInterfaceIsNull = false;
            }
            // determine if request.NewPrivateVirtualInterface should be set to null
            if (requestNewPrivateVirtualInterfaceIsNull)
            {
                request.NewPrivateVirtualInterface = 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);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreatePrivateVirtualInterface operation.
        /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.CreatePrivateVirtualInterface"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreatePrivateVirtualInterface operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public async Task<CreatePrivateVirtualInterfaceResponse> CreatePrivateVirtualInterfaceAsync(CreatePrivateVirtualInterfaceRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreatePrivateVirtualInterfaceRequestMarshaller();
            var unmarshaller = CreatePrivateVirtualInterfaceResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreatePrivateVirtualInterfaceRequest, CreatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }