예제 #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonPollyConfig config = new AmazonPollyConfig();

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

            ListSpeechSynthesisTasksResponse resp = new ListSpeechSynthesisTasksResponse();

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

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

                foreach (var obj in resp.SynthesisTasks)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
예제 #2
0
        /// <summary>
        /// Returns a list of SpeechSynthesisTask objects ordered by their creation date. This
        /// operation can filter the tasks by their status, for example, allowing users to list
        /// only tasks that are completed.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListSpeechSynthesisTasks service method.</param>
        ///
        /// <returns>The response from the ListSpeechSynthesisTasks service method, as returned by Polly.</returns>
        /// <exception cref="Amazon.Polly.Model.InvalidNextTokenException">
        /// The NextToken is invalid. Verify that it's spelled correctly, and then try again.
        /// </exception>
        /// <exception cref="Amazon.Polly.Model.ServiceFailureException">
        /// An unknown condition has caused a service failure.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListSpeechSynthesisTasks">REST API Reference for ListSpeechSynthesisTasks Operation</seealso>
        public virtual ListSpeechSynthesisTasksResponse ListSpeechSynthesisTasks(ListSpeechSynthesisTasksRequest request)
        {
            var marshaller   = ListSpeechSynthesisTasksRequestMarshaller.Instance;
            var unmarshaller = ListSpeechSynthesisTasksResponseUnmarshaller.Instance;

            return(Invoke <ListSpeechSynthesisTasksRequest, ListSpeechSynthesisTasksResponse>(request, marshaller, unmarshaller));
        }
예제 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListSpeechSynthesisTasks operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListSpeechSynthesisTasks operation on AmazonPollyClient.</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 EndListSpeechSynthesisTasks
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListSpeechSynthesisTasks">REST API Reference for ListSpeechSynthesisTasks Operation</seealso>
        public virtual IAsyncResult BeginListSpeechSynthesisTasks(ListSpeechSynthesisTasksRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = ListSpeechSynthesisTasksRequestMarshaller.Instance;
            var unmarshaller = ListSpeechSynthesisTasksResponseUnmarshaller.Instance;

            return(BeginInvoke <ListSpeechSynthesisTasksRequest>(request, marshaller, unmarshaller,
                                                                 callback, state));
        }
예제 #4
0
        internal virtual ListSpeechSynthesisTasksResponse ListSpeechSynthesisTasks(ListSpeechSynthesisTasksRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListSpeechSynthesisTasksRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListSpeechSynthesisTasksResponseUnmarshaller.Instance;

            return(Invoke <ListSpeechSynthesisTasksResponse>(request, options));
        }
예제 #5
0
        /// <summary>
        /// Returns a list of SpeechSynthesisTask objects ordered by their creation date. This
        /// operation can filter the tasks by their status, for example, allowing users to list
        /// only tasks that are completed.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListSpeechSynthesisTasks 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 ListSpeechSynthesisTasks service method, as returned by Polly.</returns>
        /// <exception cref="Amazon.Polly.Model.InvalidNextTokenException">
        /// The NextToken is invalid. Verify that it's spelled correctly, and then try again.
        /// </exception>
        /// <exception cref="Amazon.Polly.Model.ServiceFailureException">
        /// An unknown condition has caused a service failure.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListSpeechSynthesisTasks">REST API Reference for ListSpeechSynthesisTasks Operation</seealso>
        public virtual Task <ListSpeechSynthesisTasksResponse> ListSpeechSynthesisTasksAsync(ListSpeechSynthesisTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListSpeechSynthesisTasksRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListSpeechSynthesisTasksResponseUnmarshaller.Instance;

            return(InvokeAsync <ListSpeechSynthesisTasksResponse>(request, options, cancellationToken));
        }