Container for the parameters to the UploadDocuments operation. Posts a batch of documents to a search domain for indexing. A document batch is a collection of add and delete operations that represent the documents you want to add, update, or delete from your domain. Batches can be described in either JSON or XML. Each item that you want Amazon CloudSearch to return as a search result (such as a product) is represented as a document. Every document has a unique ID and one or more fields that contain the data that you want to search and return in results. Individual documents cannot contain more than 1 MB of data. The entire batch cannot exceed 5 MB. To get the best possible upload performance, group add and delete operations in batches that are close the 5 MB limit. Submitting a large volume of single-document batches can overload a domain's document service.

The endpoint for submitting UploadDocuments requests is domain-specific. To get the document endpoint for your domain, use the Amazon CloudSearch configuration service DescribeDomains action. A domain's endpoints are also displayed on the domain dashboard in the Amazon CloudSearch console.

For more information about formatting your data for Amazon CloudSearch, see Preparing Your Data in the Amazon CloudSearch Developer Guide. For more information about uploading data for indexing, see Uploading Data in the Amazon CloudSearch Developer Guide.

        /// <summary>
        /// Initiates the asynchronous execution of the UploadDocuments operation.
        /// <seealso cref="Amazon.CloudSearchDomain.IAmazonCloudSearchDomain"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UploadDocuments 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<UploadDocumentsResponse> UploadDocumentsAsync(UploadDocumentsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UploadDocumentsRequestMarshaller();
            var unmarshaller = UploadDocumentsResponseUnmarshaller.Instance;

            return InvokeAsync<UploadDocumentsRequest,UploadDocumentsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the UploadDocuments operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UploadDocuments operation on AmazonCloudSearchDomainClient.</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 EndUploadDocuments
        ///         operation.</returns>
        public IAsyncResult BeginUploadDocuments(UploadDocumentsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UploadDocumentsRequestMarshaller();
            var unmarshaller = UploadDocumentsResponseUnmarshaller.Instance;

            return BeginInvoke<UploadDocumentsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Posts a batch of documents to a search domain for indexing. A document batch is a
        /// collection of add and delete operations that represent the documents you want to add,
        /// update, or delete from your domain. Batches can be described in either JSON or XML.
        /// Each item that you want Amazon CloudSearch to return as a search result (such as a
        /// product) is represented as a document. Every document has a unique ID and one or more
        /// fields that contain the data that you want to search and return in results. Individual
        /// documents cannot contain more than 1 MB of data. The entire batch cannot exceed 5
        /// MB. To get the best possible upload performance, group add and delete operations in
        /// batches that are close the 5 MB limit. Submitting a large volume of single-document
        /// batches can overload a domain's document service. 
        /// 
        ///  
        /// <para>
        /// The endpoint for submitting <code>UploadDocuments</code> requests is domain-specific.
        /// To get the document endpoint for your domain, use the Amazon CloudSearch configuration
        /// service <code>DescribeDomains</code> action. A domain's endpoints are also displayed
        /// on the domain dashboard in the Amazon CloudSearch console. 
        /// </para>
        ///  
        /// <para>
        /// For more information about formatting your data for Amazon CloudSearch, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html">Preparing
        /// Your Data</a> in the <i>Amazon CloudSearch Developer Guide</i>. For more information
        /// about uploading data for indexing, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/uploading-data.html">Uploading
        /// Data</a> in the <i>Amazon CloudSearch Developer Guide</i>. 
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UploadDocuments service method.</param>
        /// 
        /// <returns>The response from the UploadDocuments service method, as returned by CloudSearchDomain.</returns>
        /// <exception cref="DocumentServiceException">
        /// Information about any problems encountered while processing an upload request.
        /// </exception>
        public UploadDocumentsResponse UploadDocuments(UploadDocumentsRequest request)
        {
            var marshaller = new UploadDocumentsRequestMarshaller();
            var unmarshaller = UploadDocumentsResponseUnmarshaller.Instance;

            return Invoke<UploadDocumentsRequest,UploadDocumentsResponse>(request, marshaller, unmarshaller);
        }
 internal UploadDocumentsResponse UploadDocuments(UploadDocumentsRequest request)
 {
     var task = UploadDocumentsAsync(request);
     try
     {
         return task.Result;
     }
     catch(AggregateException e)
     {
         ExceptionDispatchInfo.Capture(e.InnerException).Throw();
         return null;
     }
 }
        IAsyncResult invokeUploadDocuments(UploadDocumentsRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new UploadDocumentsRequestMarshaller();
            var unmarshaller = UploadDocumentsResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the UploadDocuments operation.
 /// <seealso cref="Amazon.CloudSearchDomain.IAmazonCloudSearchDomain"/>
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the UploadDocuments operation on AmazonCloudSearchDomainClient.</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 EndUploadDocuments
 ///         operation.</returns>
 public IAsyncResult BeginUploadDocuments(UploadDocumentsRequest request, AsyncCallback callback, object state)
 {
     return invokeUploadDocuments(request, callback, state, false);
 }
 /// <summary>
 /// Posts a batch of documents to a search domain for indexing.  A document batch is a
 /// collection of add and delete operations that represent the documents you want to add,
 /// update, or delete from your domain. Batches can be described in either JSON or XML.
 /// Each item that you want Amazon CloudSearch to return as a search result (such as a
 /// product) is represented as a document. Every document has a unique ID and one or more
 /// fields that contain the data that you want to search and return in results. Individual
 /// documents  cannot contain more than 1 MB of data. The entire batch cannot exceed 5
 /// MB. To get the best possible upload performance, group add and delete operations in
 /// batches that are close the 5 MB limit. Submitting a large volume of single-document
 /// batches can overload a domain's document service.  
 /// 
 ///       
 /// <para>
 /// The endpoint for submitting <code>UploadDocuments</code> requests is domain-specific.
 /// To get the document endpoint for your domain, use the Amazon CloudSearch configuration
 /// service <code>DescribeDomains</code> action. A domain's endpoints are also displayed
 /// on the domain dashboard in the Amazon CloudSearch console. 
 /// </para>
 ///       
 /// <para>
 /// For more information about formatting your data for Amazon CloudSearch, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html">Preparing
 /// Your Data</a> in the <i>Amazon CloudSearch Developer Guide</i>.       For more information
 /// about uploading data for indexing, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/uploading-data.html">Uploading
 /// Data</a> in the <i>Amazon CloudSearch Developer Guide</i>. 
 /// </para>
 /// </summary>
 /// <param name="request">Container for the necessary parameters to execute the UploadDocuments service method.</param>
 /// 
 /// <returns>The response from the UploadDocuments service method, as returned by CloudSearchDomain.</returns>
 /// <exception cref="DocumentServiceException">
 /// Information about any problems encountered while processing an upload request.
 /// </exception>
 public UploadDocumentsResponse UploadDocuments(UploadDocumentsRequest request)
 {
     IAsyncResult asyncResult = invokeUploadDocuments(request, null, null, true);
     return EndUploadDocuments(asyncResult);
 }
        private Amazon.CloudSearchDomain.Model.UploadDocumentsResponse CallAWSServiceOperation(IAmazonCloudSearchDomain client, Amazon.CloudSearchDomain.Model.UploadDocumentsRequest request)
        {
            Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudSearchDomain", "UploadDocuments");

            try
            {
#if DESKTOP
                return(client.UploadDocuments(request));
#elif CORECLR
                return(client.UploadDocumentsAsync(request).GetAwaiter().GetResult());
#else
#error "Unknown build edition"
#endif
            }
            catch (AmazonServiceException exc)
            {
                var webException = exc.InnerException as System.Net.WebException;
                if (webException != null)
                {
                    throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
                }

                throw;
            }
        }