/// <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 override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonMediaStoreDataConfig config = new AmazonMediaStoreDataConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonMediaStoreDataClient client = new AmazonMediaStoreDataClient(creds, config);

            ListItemsResponse resp = new ListItemsResponse();

            do
            {
                ListItemsRequest req = new ListItemsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListItems(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Items)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <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));
        }
Beispiel #4
0
        /// <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   = ListItemsRequestMarshaller.Instance;
            var unmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListItemsRequest, ListItemsResponse>(request, marshaller,
                                                                     unmarshaller, cancellationToken));
        }
        /// <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>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </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 Task <ListItemsResponse> ListItemsAsync(ListItemsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListItemsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListItemsResponse>(request, options, cancellationToken));
        }
        internal virtual ListItemsResponse ListItems(ListItemsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListItemsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(Invoke <ListItemsResponse>(request, options));
        }
        /// <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 options = new InvokeOptions();

            options.RequestMarshaller    = ListItemsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListItemsResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }