public void CreateRouteMarshallTest() { var operation = service_model.FindOperation("CreateRoute"); var request = InstantiateClassGenerator.Execute <CreateRouteRequest>(); var marshaller = new CreateRouteRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateRoute", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateRouteResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateRouteResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
public void CreateRouteMarshallTest() { var operation = service_model.FindOperation("CreateRoute"); var request = InstantiateClassGenerator.Execute<CreateRouteRequest>(); var marshaller = new CreateRouteRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); UnmarshallerContext context = new EC2UnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, new WebResponseData()); var response = CreateRouteResponseUnmarshaller.Instance.Unmarshall(context) as CreateRouteResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the CreateRoute operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateRoute 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<CreateRouteResponse> CreateRouteAsync(CreateRouteRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateRouteRequestMarshaller(); var unmarshaller = CreateRouteResponseUnmarshaller.Instance; return InvokeAsync<CreateRouteRequest,CreateRouteResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Creates a route in a route table within a VPC. /// /// /// <para> /// You must specify one of the following targets: Internet gateway or virtual private /// gateway, NAT instance, VPC peering connection, or network interface. /// </para> /// /// <para> /// When determining how to route traffic, we use the route with the most specific match. /// For example, let's say the traffic is destined for <code>192.0.2.3</code>, and the /// route table includes the following two routes: /// </para> /// <ul> <li> /// <para> /// <code>192.0.2.0/24</code> (goes to some target A) /// </para> /// </li> <li> /// <para> /// <code>192.0.2.0/28</code> (goes to some target B) /// </para> /// </li> </ul> /// <para> /// Both routes apply to the traffic destined for <code>192.0.2.3</code>. However, the /// second route in the list covers a smaller number of IP addresses and is therefore /// more specific, so we use that route to determine where to target the traffic. /// </para> /// /// <para> /// For more information about route tables, see <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route /// Tables</a> in the <i>Amazon Virtual Private Cloud User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateRoute service method.</param> /// /// <returns>The response from the CreateRoute service method, as returned by EC2.</returns> public CreateRouteResponse CreateRoute(CreateRouteRequest request) { var marshaller = new CreateRouteRequestMarshaller(); var unmarshaller = CreateRouteResponseUnmarshaller.Instance; return Invoke<CreateRouteRequest,CreateRouteResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateRoute operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateRoute operation on AmazonEC2Client.</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 EndCreateRoute /// operation.</returns> public IAsyncResult BeginCreateRoute(CreateRouteRequest request, AsyncCallback callback, object state) { var marshaller = new CreateRouteRequestMarshaller(); var unmarshaller = CreateRouteResponseUnmarshaller.Instance; return BeginInvoke<CreateRouteRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeCreateRoute(CreateRouteRequest createRouteRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateRouteRequestMarshaller().Marshall(createRouteRequest); var unmarshaller = CreateRouteResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Creates a route in a route table within a VPC.</para> <para>You must specify one of the following targets: Internet gateway, NAT /// instance, or network interface.</para> <para>When determining how to route traffic, we use the route with the most specific match. For /// example, let's say the traffic is destined for <c>192.0.2.3</c> , and the route table includes the following two routes:</para> /// <ul> /// <li> <para> <c>192.0.2.0/24</c> (goes to some target A)</para> </li> /// <li> <para> <c>192.0.2.0/28</c> (goes to some target B)</para> </li> /// /// </ul> /// <para>Both routes apply to the traffic destined for <c>192.0.2.3</c> . However, the second route in the list covers a smaller number of IP /// addresses and is therefore more specific, so we use that route to determine where to target the traffic.</para> <para>For more information /// about route tables, see <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route Tables</a> in the /// <i>Amazon Virtual Private Cloud User Guide</i> .</para> /// </summary> /// /// <param name="createRouteRequest">Container for the necessary parameters to execute the CreateRoute service method on AmazonEC2.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CreateRouteResponse> CreateRouteAsync(CreateRouteRequest createRouteRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateRouteRequestMarshaller(); var unmarshaller = CreateRouteResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateRouteRequest, CreateRouteResponse>(createRouteRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CreateRoute operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.CreateRoute"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateRoute 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<CreateRouteResponse> CreateRouteAsync(CreateRouteRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateRouteRequestMarshaller(); var unmarshaller = CreateRouteResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateRouteRequest, CreateRouteResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
public void CreateRouteMarshallTest() { var operation = service_model.FindOperation("CreateRoute"); var request = InstantiateClassGenerator.Execute<CreateRouteRequest>(); var marshaller = new CreateRouteRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); }