/// <summary> /// Initiates the asynchronous execution of the AllocatePrivateVirtualInterface operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface 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 EndAllocatePrivateVirtualInterface /// operation.</returns> public IAsyncResult BeginAllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest request, AsyncCallback callback, object state) { var marshaller = new AllocatePrivateVirtualInterfaceRequestMarshaller(); var unmarshaller = AllocatePrivateVirtualInterfaceResponseUnmarshaller.Instance; return BeginInvoke<AllocatePrivateVirtualInterfaceRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the AllocatePrivateVirtualInterface operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.AllocatePrivateVirtualInterface"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface 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<AllocatePrivateVirtualInterfaceResponse> AllocatePrivateVirtualInterfaceAsync(AllocatePrivateVirtualInterfaceRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AllocatePrivateVirtualInterfaceRequestMarshaller(); var unmarshaller = AllocatePrivateVirtualInterfaceResponseUnmarshaller.GetInstance(); return Invoke<IRequest, AllocatePrivateVirtualInterfaceRequest, AllocatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Provisions a private virtual interface to be owned by a different customer. /// /// /// <para> /// The owner of a connection calls this function to provision a private virtual interface /// which will be owned by another AWS customer. /// </para> /// /// <para> /// Virtual interfaces created using this function must be confirmed by the virtual interface /// owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, /// the virtual interface will be in 'Confirming' state, and will not be available for /// handling traffic. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface service method.</param> /// /// <returns>The response from the AllocatePrivateVirtualInterface 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 AllocatePrivateVirtualInterfaceResponse AllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest request) { var marshaller = new AllocatePrivateVirtualInterfaceRequestMarshaller(); var unmarshaller = AllocatePrivateVirtualInterfaceResponseUnmarshaller.Instance; return Invoke<AllocatePrivateVirtualInterfaceRequest,AllocatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para>Provisions a private virtual interface to be owned by a different customer.</para> <para>The owner of a connection calls this function /// to provision a private virtual interface which will be owned by another AWS customer.</para> <para>Virtual interfaces created using this /// function must be confirmed by the virtual interface owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, /// the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface /// service method on AmazonDirectConnect.</param> /// /// <returns>The response from the AllocatePrivateVirtualInterface service method, as returned by AmazonDirectConnect.</returns> /// /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" /> /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" /> public AllocatePrivateVirtualInterfaceResponse AllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest request) { var task = AllocatePrivateVirtualInterfaceAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para>Provisions a private virtual interface to be owned by a different customer.</para> <para>The owner of a connection calls this function /// to provision a private virtual interface which will be owned by another AWS customer.</para> <para>Virtual interfaces created using this /// function must be confirmed by the virtual interface owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, /// the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface /// service method on AmazonDirectConnect.</param> /// /// <returns>The response from the AllocatePrivateVirtualInterface service method, as returned by AmazonDirectConnect.</returns> /// /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectServerException" /> /// <exception cref="T:Amazon.DirectConnect.Model.DirectConnectClientException" /> public AllocatePrivateVirtualInterfaceResponse AllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest request) { var task = AllocatePrivateVirtualInterfaceAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the AllocatePrivateVirtualInterface operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.AllocatePrivateVirtualInterface"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface 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<AllocatePrivateVirtualInterfaceResponse> AllocatePrivateVirtualInterfaceAsync(AllocatePrivateVirtualInterfaceRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AllocatePrivateVirtualInterfaceRequestMarshaller(); var unmarshaller = AllocatePrivateVirtualInterfaceResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, AllocatePrivateVirtualInterfaceRequest, AllocatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the AllocatePrivateVirtualInterface operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface 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<AllocatePrivateVirtualInterfaceResponse> AllocatePrivateVirtualInterfaceAsync(AllocatePrivateVirtualInterfaceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AllocatePrivateVirtualInterfaceRequestMarshaller(); var unmarshaller = AllocatePrivateVirtualInterfaceResponseUnmarshaller.Instance; return InvokeAsync<AllocatePrivateVirtualInterfaceRequest,AllocatePrivateVirtualInterfaceResponse>(request, marshaller, unmarshaller, cancellationToken); }
private Amazon.DirectConnect.Model.AllocatePrivateVirtualInterfaceResponse CallAWSServiceOperation(IAmazonDirectConnect client, Amazon.DirectConnect.Model.AllocatePrivateVirtualInterfaceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Direct Connect", "AllocatePrivateVirtualInterface"); try { #if DESKTOP return(client.AllocatePrivateVirtualInterface(request)); #elif CORECLR return(client.AllocatePrivateVirtualInterfaceAsync(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.AllocatePrivateVirtualInterfaceRequest(); if (cmdletContext.ConnectionId != null) { request.ConnectionId = cmdletContext.ConnectionId; } // populate NewPrivateVirtualInterfaceAllocation var requestNewPrivateVirtualInterfaceAllocationIsNull = true; request.NewPrivateVirtualInterfaceAllocation = new Amazon.DirectConnect.Model.NewPrivateVirtualInterfaceAllocation(); Amazon.DirectConnect.AddressFamily requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AddressFamily = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_AddressFamily != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AddressFamily = cmdletContext.NewPrivateVirtualInterfaceAllocation_AddressFamily; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AddressFamily != null) { request.NewPrivateVirtualInterfaceAllocation.AddressFamily = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AddressFamily; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.String requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AmazonAddress = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_AmazonAddress != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AmazonAddress = cmdletContext.NewPrivateVirtualInterfaceAllocation_AmazonAddress; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AmazonAddress != null) { request.NewPrivateVirtualInterfaceAllocation.AmazonAddress = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AmazonAddress; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.Int32?requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Asn = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_Asn != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Asn = cmdletContext.NewPrivateVirtualInterfaceAllocation_Asn.Value; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Asn != null) { request.NewPrivateVirtualInterfaceAllocation.Asn = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Asn.Value; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.String requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AuthKey = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_AuthKey != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AuthKey = cmdletContext.NewPrivateVirtualInterfaceAllocation_AuthKey; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AuthKey != null) { request.NewPrivateVirtualInterfaceAllocation.AuthKey = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_AuthKey; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.String requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_CustomerAddress = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_CustomerAddress != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_CustomerAddress = cmdletContext.NewPrivateVirtualInterfaceAllocation_CustomerAddress; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_CustomerAddress != null) { request.NewPrivateVirtualInterfaceAllocation.CustomerAddress = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_CustomerAddress; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.Int32?requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Mtu = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_Mtu != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Mtu = cmdletContext.NewPrivateVirtualInterfaceAllocation_Mtu.Value; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Mtu != null) { request.NewPrivateVirtualInterfaceAllocation.Mtu = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Mtu.Value; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } List <Amazon.DirectConnect.Model.Tag> requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Tag = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_Tag != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Tag = cmdletContext.NewPrivateVirtualInterfaceAllocation_Tag; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Tag != null) { request.NewPrivateVirtualInterfaceAllocation.Tags = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Tag; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.String requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_VirtualInterfaceName = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_VirtualInterfaceName != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_VirtualInterfaceName = cmdletContext.NewPrivateVirtualInterfaceAllocation_VirtualInterfaceName; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_VirtualInterfaceName != null) { request.NewPrivateVirtualInterfaceAllocation.VirtualInterfaceName = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_VirtualInterfaceName; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } System.Int32?requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Vlan = null; if (cmdletContext.NewPrivateVirtualInterfaceAllocation_Vlan != null) { requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Vlan = cmdletContext.NewPrivateVirtualInterfaceAllocation_Vlan.Value; } if (requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Vlan != null) { request.NewPrivateVirtualInterfaceAllocation.Vlan = requestNewPrivateVirtualInterfaceAllocation_newPrivateVirtualInterfaceAllocation_Vlan.Value; requestNewPrivateVirtualInterfaceAllocationIsNull = false; } // determine if request.NewPrivateVirtualInterfaceAllocation should be set to null if (requestNewPrivateVirtualInterfaceAllocationIsNull) { request.NewPrivateVirtualInterfaceAllocation = null; } if (cmdletContext.OwnerAccount != null) { request.OwnerAccount = cmdletContext.OwnerAccount; } 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); }
IAsyncResult invokeAllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest allocatePrivateVirtualInterfaceRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new AllocatePrivateVirtualInterfaceRequestMarshaller().Marshall(allocatePrivateVirtualInterfaceRequest); var unmarshaller = AllocatePrivateVirtualInterfaceResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the AllocatePrivateVirtualInterface operation. /// <seealso cref="Amazon.DirectConnect.IAmazonDirectConnect.AllocatePrivateVirtualInterface"/> /// </summary> /// /// <param name="allocatePrivateVirtualInterfaceRequest">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface /// 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 /// EndAllocatePrivateVirtualInterface operation.</returns> public IAsyncResult BeginAllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest allocatePrivateVirtualInterfaceRequest, AsyncCallback callback, object state) { return invokeAllocatePrivateVirtualInterface(allocatePrivateVirtualInterfaceRequest, callback, state, false); }
/// <summary> /// <para>Provisions a private virtual interface to be owned by a different customer.</para> <para>The owner of a connection calls this function /// to provision a private virtual interface which will be owned by another AWS customer.</para> <para>Virtual interfaces created using this /// function must be confirmed by the virtual interface owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, /// the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</para> /// </summary> /// /// <param name="allocatePrivateVirtualInterfaceRequest">Container for the necessary parameters to execute the AllocatePrivateVirtualInterface /// service method on AmazonDirectConnect.</param> /// /// <returns>The response from the AllocatePrivateVirtualInterface service method, as returned by AmazonDirectConnect.</returns> /// /// <exception cref="DirectConnectServerException"/> /// <exception cref="DirectConnectClientException"/> public AllocatePrivateVirtualInterfaceResponse AllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest allocatePrivateVirtualInterfaceRequest) { IAsyncResult asyncResult = invokeAllocatePrivateVirtualInterface(allocatePrivateVirtualInterfaceRequest, null, null, true); return EndAllocatePrivateVirtualInterface(asyncResult); }