public void DescribeAffectedEntitiesMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <DescribeAffectedEntitiesRequest>();
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();

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

            Comparer.CompareObjectToJson <DescribeAffectedEntitiesRequest>(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("DescribeAffectedEntities").ResponseStructure).Execute();

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

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        public void DescribeAffectedEntities_UnsupportedLocaleExceptionMarshallTest()
        {
            var operation = service_model.FindOperation("DescribeAffectedEntities");

            var request         = InstantiateClassGenerator.Execute <DescribeAffectedEntitiesRequest>();
            var marshaller      = new DescribeAffectedEntitiesRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

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

            var exception    = operation.Exceptions.First(e => e.Name.Equals("UnsupportedLocaleException"));
            var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute();
            var webResponse  = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString()                                  },
                    { "x-amz-crc32",      "0"                                                        },
                    { "x-amzn-ErrorType", "UnsupportedLocaleException"                               },
                    { "Content-Length",   UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString() }
                }
            };
            var context  = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true);
            var response = DescribeAffectedEntitiesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK);

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Example #3
0
        internal DescribeAffectedEntitiesResponse DescribeAffectedEntities(DescribeAffectedEntitiesRequest request)
        {
            var marshaller   = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return(Invoke <DescribeAffectedEntitiesRequest, DescribeAffectedEntitiesResponse>(request, marshaller, unmarshaller));
        }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAffectedEntities operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeAffectedEntities">REST API Reference for DescribeAffectedEntities Operation</seealso>
        public Task <DescribeAffectedEntitiesResponse> DescribeAffectedEntitiesAsync(DescribeAffectedEntitiesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeAffectedEntitiesRequest, DescribeAffectedEntitiesResponse>(request, marshaller,
                                                                                                   unmarshaller, cancellationToken));
        }
Example #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAffectedEntities operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities operation on AmazonAWSHealthClient.</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 EndDescribeAffectedEntities
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeAffectedEntities">REST API Reference for DescribeAffectedEntities Operation</seealso>
        public IAsyncResult BeginDescribeAffectedEntities(DescribeAffectedEntitiesRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return(BeginInvoke <DescribeAffectedEntitiesRequest>(request, marshaller, unmarshaller,
                                                                 callback, state));
        }
        public void DescribeAffectedEntitiesMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<DescribeAffectedEntitiesRequest>();
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<DescribeAffectedEntitiesRequest>(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("DescribeAffectedEntities").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = DescribeAffectedEntitiesResponseUnmarshaller.Instance.Unmarshall(context)
                as DescribeAffectedEntitiesResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Example #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAffectedEntities operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities 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<DescribeAffectedEntitiesResponse> DescribeAffectedEntitiesAsync(DescribeAffectedEntitiesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return InvokeAsync<DescribeAffectedEntitiesRequest,DescribeAffectedEntitiesResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Example #8
0
        /// <summary>
        /// Gets a list of entities that have been attached to events, based on the specified
        /// filter criteria. Entities can refer to individual customer resources, groups of customer
        /// resources, or any other construct, depending on the AWS service. Events that have
        /// impact beyond that of the attached entities, or where the extent of impact is unknown,
        /// include at least one entity indicating this. If no filter criteria are specified,
        /// all entities are returned. Results are sorted by the <code>lastUpdatedTime</code>
        /// of the entity, starting with the most recent.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities service method.</param>
        /// 
        /// <returns>The response from the DescribeAffectedEntities service method, as returned by AWSHealth.</returns>
        /// <exception cref="Amazon.AWSHealth.Model.InvalidPaginationTokenException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.AWSHealth.Model.UnsupportedLocaleException">
        /// 
        /// </exception>
        public DescribeAffectedEntitiesResponse DescribeAffectedEntities(DescribeAffectedEntitiesRequest request)
        {
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return Invoke<DescribeAffectedEntitiesRequest,DescribeAffectedEntitiesResponse>(request, marshaller, unmarshaller);
        }
Example #9
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeAffectedEntities operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeAffectedEntities operation on AmazonAWSHealthClient.</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 EndDescribeAffectedEntities
        ///         operation.</returns>
        public IAsyncResult BeginDescribeAffectedEntities(DescribeAffectedEntitiesRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DescribeAffectedEntitiesRequestMarshaller();
            var unmarshaller = DescribeAffectedEntitiesResponseUnmarshaller.Instance;

            return BeginInvoke<DescribeAffectedEntitiesRequest>(request, marshaller, unmarshaller,
                callback, state);
        }