/// <summary>
        /// Provides a list of metadata entries about folders and objects in the specified folder.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListItems service method.</param>
        ///
        /// <returns>The response from the ListItems service method, as returned by MediaStoreData.</returns>
        /// <exception cref="Amazon.MediaStoreData.Model.ContainerNotFoundException">
        /// The specified container was not found for the specified account.
        /// </exception>
        /// <exception cref="Amazon.MediaStoreData.Model.InternalServerErrorException">
        /// The service is temporarily unavailable.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/ListItems">REST API Reference for ListItems Operation</seealso>
        public virtual ListItemsResponse ListItems(ListItemsRequest request)
        {
            var marshaller   = new ListItemsRequestMarshaller();
            var unmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(Invoke <ListItemsRequest, ListItemsResponse>(request, marshaller, unmarshaller));
        }
        public void ListItemsMarshallTest()
        {
            var operation = service_model.FindOperation("ListItems");

            var request    = InstantiateClassGenerator.Execute <ListItemsRequest>();
            var marshaller = new ListItemsRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("ListItems", 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 = ListItemsResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as ListItemsResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
예제 #3
0
        public void ListItems_InternalServerErrorExceptionMarshallTest()
        {
            var operation = service_model.FindOperation("ListItems");

            var request         = InstantiateClassGenerator.Execute <ListItemsRequest>();
            var marshaller      = new ListItemsRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("ListItems", request, internalRequest, service_model);

            var exception   = operation.Exceptions.First(e => e.Name.Equals("InternalServerErrorException"));
            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString()      },
                    { "x-amz-crc32",      "0"                            },
                    { "x-amzn-ErrorType", "InternalServerErrorException" },
                }
            };

            var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute();

            webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
            var context  = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true);
            var response = ListItemsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK);

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListItems operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListItems operation on AmazonMediaStoreDataClient.</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 EndListItems
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/ListItems">REST API Reference for ListItems Operation</seealso>
        public virtual IAsyncResult BeginListItems(ListItemsRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new ListItemsRequestMarshaller();
            var unmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(BeginInvoke <ListItemsRequest>(request, marshaller, unmarshaller,
                                                  callback, state));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListItems operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListItems 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/mediastore-data-2017-09-01/ListItems">REST API Reference for ListItems Operation</seealso>
        public virtual Task <ListItemsResponse> ListItemsAsync(ListItemsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListItemsRequestMarshaller();
            var unmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListItemsRequest, ListItemsResponse>(request, marshaller,
                                                                     unmarshaller, cancellationToken));
        }