示例#1
0
        public void StartLoggingMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <StartLoggingRequest>();
            var marshaller = new StartLoggingRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <StartLoggingRequest>(request, jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("StartLogging").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = StartLoggingResponseUnmarshaller.Instance.Unmarshall(context)
                           as StartLoggingResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartLogging operation.
        /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.StartLogging"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartLogging 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 <StartLoggingResponse> StartLoggingAsync(StartLoggingRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, StartLoggingRequest, StartLoggingResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
示例#3
0
        internal StartLoggingResponse StartLogging(StartLoggingRequest request)
        {
            var marshaller   = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.Instance;

            return(Invoke <StartLoggingRequest, StartLoggingResponse>(request, marshaller, unmarshaller));
        }
示例#4
0
        /// <summary>
        /// Initiates the asynchronous execution of the StartLogging operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartLogging 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 <StartLoggingResponse> StartLoggingAsync(StartLoggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.Instance;

            return(InvokeAsync <StartLoggingRequest, StartLoggingResponse>(request, marshaller,
                                                                           unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartLogging operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartLogging operation on AmazonCloudTrailClient.</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 EndStartLogging
        ///         operation.</returns>
        public IAsyncResult BeginStartLogging(StartLoggingRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.Instance;

            return(BeginInvoke <StartLoggingRequest>(request, marshaller, unmarshaller,
                                                     callback, state));
        }
        IAsyncResult invokeStartLogging(StartLoggingRequest startLoggingRequest, AsyncCallback callback, object state, bool synchronized)
        {
            IRequest    irequest     = new StartLoggingRequestMarshaller().Marshall(startLoggingRequest);
            var         unmarshaller = StartLoggingResponseUnmarshaller.GetInstance();
            AsyncResult result       = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);

            Invoke(result);
            return(result);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartLogging operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartLogging operation on AmazonCloudTrailClient.</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 EndStartLogging
        ///         operation.</returns>
        public IAsyncResult BeginStartLogging(StartLoggingRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.Instance;

            return BeginInvoke<StartLoggingRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Starts the recording of AWS API calls and log file delivery for a trail.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the StartLogging service method.</param>
        /// 
        /// <returns>The response from the StartLogging service method, as returned by CloudTrail.</returns>
        /// <exception cref="Amazon.CloudTrail.Model.InvalidTrailNameException">
        /// This exception is thrown when the provided trail name is not valid. Trail names must
        /// meet the following requirements:
        /// 
        ///  <ul> <li>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
        /// (_), or dashes (-)</li> <li>Start with a letter or number, and end with a letter or
        /// number</li> <li>Be between 3 and 128 characters</li> <li>Have no adjacent periods,
        /// underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code>
        /// are invalid.</li> <li>Not be in IP address format (for example, 192.168.5.4)</li>
        /// </ul>
        /// </exception>
        /// <exception cref="Amazon.CloudTrail.Model.TrailNotFoundException">
        /// This exception is thrown when the trail with the given name is not found.
        /// </exception>
        public StartLoggingResponse StartLogging(StartLoggingRequest request)
        {
            var marshaller = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.Instance;

            return Invoke<StartLoggingRequest,StartLoggingResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartLogging operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartLogging 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<StartLoggingResponse> StartLoggingAsync(StartLoggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.Instance;

            return InvokeAsync<StartLoggingRequest,StartLoggingResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 IAsyncResult invokeStartLogging(StartLoggingRequest startLoggingRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new StartLoggingRequestMarshaller().Marshall(startLoggingRequest);
     var unmarshaller = StartLoggingResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        public void StartLoggingMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<StartLoggingRequest>();
            var marshaller = new StartLoggingRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<StartLoggingRequest>(request,jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("StartLogging").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = StartLoggingResponseUnmarshaller.Instance.Unmarshall(context)
                as StartLoggingResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// <para>Starts the recording of AWS API calls and log file delivery for a trail.</para>
        /// </summary>
        /// 
        /// <param name="startLoggingRequest">Container for the necessary parameters to execute the StartLogging service method on
        /// AmazonCloudTrail.</param>
        /// 
        /// <returns>The response from the StartLogging service method, as returned by AmazonCloudTrail.</returns>
        /// 
        /// <exception cref="T:Amazon.CloudTrail.Model.InvalidTrailNameException" />
        /// <exception cref="T:Amazon.CloudTrail.Model.TrailNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<StartLoggingResponse> StartLoggingAsync(StartLoggingRequest startLoggingRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, StartLoggingRequest, StartLoggingResponse>(startLoggingRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartLogging operation.
        /// <seealso cref="Amazon.CloudTrail.IAmazonCloudTrail.StartLogging"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartLogging 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<StartLoggingResponse> StartLoggingAsync(StartLoggingRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new StartLoggingRequestMarshaller();
            var unmarshaller = StartLoggingResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, StartLoggingRequest, StartLoggingResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }