/// <summary>
        /// Lists the properties of all containers in AWS Elemental MediaStore.
        ///
        ///
        /// <para>
        /// You can query to receive all the containers in one response. Or you can include the
        /// <code>MaxResults</code> parameter to receive a limited number of containers in each
        /// response. In this case, the response includes a token. To get the next set of containers,
        /// send the command again, this time with the <code>NextToken</code> parameter (with
        /// the returned token as its value). The next set of responses appears, with a token
        /// if there are still more containers to receive.
        /// </para>
        ///
        /// <para>
        /// See also <a>DescribeContainer</a>, which gets the properties of one container.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListContainers service method.</param>
        ///
        /// <returns>The response from the ListContainers service method, as returned by MediaStore.</returns>
        /// <exception cref="Amazon.MediaStore.Model.InternalServerErrorException">
        /// The service is temporarily unavailable.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListContainers">REST API Reference for ListContainers Operation</seealso>
        public virtual ListContainersResponse ListContainers(ListContainersRequest request)
        {
            var marshaller   = new ListContainersRequestMarshaller();
            var unmarshaller = ListContainersResponseUnmarshaller.Instance;

            return(Invoke <ListContainersRequest, ListContainersResponse>(request, marshaller, unmarshaller));
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonMediaStoreConfig config = new AmazonMediaStoreConfig();

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

            ListContainersResponse resp = new ListContainersResponse();

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

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

                foreach (var obj in resp.Containers)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListContainers operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListContainers operation on AmazonMediaStoreClient.</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 EndListContainers
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListContainers">REST API Reference for ListContainers Operation</seealso>
        public virtual IAsyncResult BeginListContainers(ListContainersRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new ListContainersRequestMarshaller();
            var unmarshaller = ListContainersResponseUnmarshaller.Instance;

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

            return(InvokeAsync <ListContainersRequest, ListContainersResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Lists the properties of all containers in AWS Elemental MediaStore.
        ///
        ///
        /// <para>
        /// You can query to receive all the containers in one response. Or you can include the
        /// <code>MaxResults</code> parameter to receive a limited number of containers in each
        /// response. In this case, the response includes a token. To get the next set of containers,
        /// send the command again, this time with the <code>NextToken</code> parameter (with
        /// the returned token as its value). The next set of responses appears, with a token
        /// if there are still more containers to receive.
        /// </para>
        ///
        /// <para>
        /// See also <a>DescribeContainer</a>, which gets the properties of one container.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListContainers 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 ListContainers service method, as returned by MediaStore.</returns>
        /// <exception cref="Amazon.MediaStore.Model.InternalServerErrorException">
        /// The service is temporarily unavailable.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListContainers">REST API Reference for ListContainers Operation</seealso>
        public virtual Task <ListContainersResponse> ListContainersAsync(ListContainersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListContainersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListContainersResponseUnmarshaller.Instance;

            return(InvokeAsync <ListContainersResponse>(request, options, cancellationToken));
        }
        internal virtual ListContainersResponse ListContainers(ListContainersRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListContainersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListContainersResponseUnmarshaller.Instance;

            return(Invoke <ListContainersResponse>(request, options));
        }
        private string BuildListContainerRequest()
        {
            string requestString = null;

            try
            {
                var request = new ListContainersRequest
                {
                    CustomerTranRef = Read_Optional_String_Input("CustomerTranRef")
                };

                requestString = JsonConvert.SerializeObject(request, Formatting.Indented);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error occurred when building ListContainersRequest: " + e.Message);
            }
            return(requestString);
        }