コード例 #1
0
        /// <summary>
        /// Initiates the asynchronous execution of the DefineAnalysisScheme operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DefineAnalysisScheme operation on AmazonCloudSearchClient.</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 EndDefineAnalysisScheme
        ///         operation.</returns>
        public IAsyncResult BeginDefineAnalysisScheme(DefineAnalysisSchemeRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DefineAnalysisSchemeRequestMarshaller();
            var unmarshaller = DefineAnalysisSchemeResponseUnmarshaller.Instance;

            return BeginInvoke<DefineAnalysisSchemeRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #2
0
 IAsyncResult invokeDefineAnalysisScheme(DefineAnalysisSchemeRequest defineAnalysisSchemeRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DefineAnalysisSchemeRequestMarshaller().Marshall(defineAnalysisSchemeRequest);
     var unmarshaller = DefineAnalysisSchemeResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
コード例 #3
0
        /// <summary>
        /// Configures an analysis scheme that can be applied to a <code>text</code> or <code>text-array</code>
        /// field to define language-specific text processing options. For more information, see
        /// <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-analysis-schemes.html"
        /// target="_blank">Configuring Analysis Schemes</a> in the <i>Amazon CloudSearch Developer
        /// Guide</i>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DefineAnalysisScheme service method.</param>
        /// 
        /// <returns>The response from the DefineAnalysisScheme service method, as returned by CloudSearch.</returns>
        /// <exception cref="Amazon.CloudSearch.Model.BaseException">
        /// An error occurred while processing the request.
        /// </exception>
        /// <exception cref="Amazon.CloudSearch.Model.InternalException">
        /// An internal error occurred while processing the request. If this problem persists,
        /// report an issue from the <a href="http://status.aws.amazon.com/" target="_blank">Service
        /// Health Dashboard</a>.
        /// </exception>
        /// <exception cref="Amazon.CloudSearch.Model.InvalidTypeException">
        /// The request was rejected because it specified an invalid type definition.
        /// </exception>
        /// <exception cref="Amazon.CloudSearch.Model.LimitExceededException">
        /// The request was rejected because a resource limit has already been met.
        /// </exception>
        /// <exception cref="Amazon.CloudSearch.Model.ResourceNotFoundException">
        /// The request was rejected because it attempted to reference a resource that does not
        /// exist.
        /// </exception>
        public DefineAnalysisSchemeResponse DefineAnalysisScheme(DefineAnalysisSchemeRequest request)
        {
            var marshaller = new DefineAnalysisSchemeRequestMarshaller();
            var unmarshaller = DefineAnalysisSchemeResponseUnmarshaller.Instance;

            return Invoke<DefineAnalysisSchemeRequest,DefineAnalysisSchemeResponse>(request, marshaller, unmarshaller);
        }
コード例 #4
0
 /// <summary>
 /// <para>Configures an analysis scheme for a domain. An analysis scheme defines language-specific text processing options for a <c>text</c>
 /// field. For more information, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-analysis-schemes.html"
 /// >Configuring Analysis Schemes</a> in the <i>Amazon CloudSearch Developer Guide</i> .</para>
 /// </summary>
 /// 
 /// <param name="defineAnalysisSchemeRequest">Container for the necessary parameters to execute the DefineAnalysisScheme service method on
 ///          AmazonCloudSearch.</param>
 /// 
 /// <returns>The response from the DefineAnalysisScheme service method, as returned by AmazonCloudSearch.</returns>
 /// 
 /// <exception cref="InternalException"/>
 /// <exception cref="InvalidTypeException"/>
 /// <exception cref="ResourceNotFoundException"/>
 /// <exception cref="LimitExceededException"/>
 /// <exception cref="BaseException"/>
 public DefineAnalysisSchemeResponse DefineAnalysisScheme(DefineAnalysisSchemeRequest defineAnalysisSchemeRequest)
 {
     IAsyncResult asyncResult = invokeDefineAnalysisScheme(defineAnalysisSchemeRequest, null, null, true);
     return EndDefineAnalysisScheme(asyncResult);
 }
コード例 #5
0
 /// <summary>
 /// Initiates the asynchronous execution of the DefineAnalysisScheme operation.
 /// <seealso cref="Amazon.CloudSearch.IAmazonCloudSearch.DefineAnalysisScheme"/>
 /// </summary>
 /// 
 /// <param name="defineAnalysisSchemeRequest">Container for the necessary parameters to execute the DefineAnalysisScheme operation on
 ///          AmazonCloudSearch.</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
 ///         EndDefineAnalysisScheme operation.</returns>
 public IAsyncResult BeginDefineAnalysisScheme(DefineAnalysisSchemeRequest defineAnalysisSchemeRequest, AsyncCallback callback, object state)
 {
     return invokeDefineAnalysisScheme(defineAnalysisSchemeRequest, callback, state, false);
 }
コード例 #6
0
        /// <summary>
        /// <para>Configures an analysis scheme for a domain. An analysis scheme defines language-specific text processing options for a <c>text</c>
        /// field. For more information, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-analysis-schemes.html">Configuring Analysis Schemes</a> in the <i>Amazon CloudSearch Developer Guide</i> .</para>
        /// </summary>
        /// 
        /// <param name="defineAnalysisSchemeRequest">Container for the necessary parameters to execute the DefineAnalysisScheme service method on
        /// AmazonCloudSearch.</param>
        /// 
        /// <returns>The response from the DefineAnalysisScheme service method, as returned by AmazonCloudSearch.</returns>
        /// 
        /// <exception cref="T:Amazon.CloudSearch.Model.InternalException" />
        /// <exception cref="T:Amazon.CloudSearch.Model.InvalidTypeException" />
        /// <exception cref="T:Amazon.CloudSearch.Model.ResourceNotFoundException" />
        /// <exception cref="T:Amazon.CloudSearch.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.CloudSearch.Model.BaseException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<DefineAnalysisSchemeResponse> DefineAnalysisSchemeAsync(DefineAnalysisSchemeRequest defineAnalysisSchemeRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DefineAnalysisSchemeRequestMarshaller();
            var unmarshaller = DefineAnalysisSchemeResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DefineAnalysisSchemeRequest, DefineAnalysisSchemeResponse>(defineAnalysisSchemeRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #7
0
		internal DefineAnalysisSchemeResponse DefineAnalysisScheme(DefineAnalysisSchemeRequest request)
        {
            var task = DefineAnalysisSchemeAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #8
0
        /// <summary>
        /// Initiates the asynchronous execution of the DefineAnalysisScheme operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DefineAnalysisScheme 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<DefineAnalysisSchemeResponse> DefineAnalysisSchemeAsync(DefineAnalysisSchemeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DefineAnalysisSchemeRequestMarshaller();
            var unmarshaller = DefineAnalysisSchemeResponseUnmarshaller.Instance;

            return InvokeAsync<DefineAnalysisSchemeRequest,DefineAnalysisSchemeResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #9
0
 private Amazon.CloudSearch.Model.DefineAnalysisSchemeResponse CallAWSServiceOperation(IAmazonCloudSearch client, Amazon.CloudSearch.Model.DefineAnalysisSchemeRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudSearch", "DefineAnalysisScheme");
     try
     {
         #if DESKTOP
         return(client.DefineAnalysisScheme(request));
         #elif CORECLR
         return(client.DefineAnalysisSchemeAsync(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;
     }
 }
コード例 #10
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudSearch.Model.DefineAnalysisSchemeRequest();


            // populate AnalysisScheme
            var requestAnalysisSchemeIsNull = true;

            request.AnalysisScheme = new Amazon.CloudSearch.Model.AnalysisScheme();
            Amazon.CloudSearch.AnalysisSchemeLanguage requestAnalysisScheme_analysisScheme_AnalysisSchemeLanguage = null;
            if (cmdletContext.AnalysisScheme_AnalysisSchemeLanguage != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisSchemeLanguage = cmdletContext.AnalysisScheme_AnalysisSchemeLanguage;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisSchemeLanguage != null)
            {
                request.AnalysisScheme.AnalysisSchemeLanguage = requestAnalysisScheme_analysisScheme_AnalysisSchemeLanguage;
                requestAnalysisSchemeIsNull = false;
            }
            System.String requestAnalysisScheme_analysisScheme_AnalysisSchemeName = null;
            if (cmdletContext.AnalysisScheme_AnalysisSchemeName != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisSchemeName = cmdletContext.AnalysisScheme_AnalysisSchemeName;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisSchemeName != null)
            {
                request.AnalysisScheme.AnalysisSchemeName = requestAnalysisScheme_analysisScheme_AnalysisSchemeName;
                requestAnalysisSchemeIsNull = false;
            }
            Amazon.CloudSearch.Model.AnalysisOptions requestAnalysisScheme_analysisScheme_AnalysisOptions = null;

            // populate AnalysisOptions
            var requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull = true;

            requestAnalysisScheme_analysisScheme_AnalysisOptions = new Amazon.CloudSearch.Model.AnalysisOptions();
            Amazon.CloudSearch.AlgorithmicStemming requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_AlgorithmicStemming = null;
            if (cmdletContext.AnalysisOptions_AlgorithmicStemming != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_AlgorithmicStemming = cmdletContext.AnalysisOptions_AlgorithmicStemming;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_AlgorithmicStemming != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions.AlgorithmicStemming = requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_AlgorithmicStemming;
                requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull = false;
            }
            System.String requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_JapaneseTokenizationDictionary = null;
            if (cmdletContext.AnalysisOptions_JapaneseTokenizationDictionary != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_JapaneseTokenizationDictionary = cmdletContext.AnalysisOptions_JapaneseTokenizationDictionary;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_JapaneseTokenizationDictionary != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions.JapaneseTokenizationDictionary = requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_JapaneseTokenizationDictionary;
                requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull = false;
            }
            System.String requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_StemmingDictionary = null;
            if (cmdletContext.AnalysisOptions_StemmingDictionary != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_StemmingDictionary = cmdletContext.AnalysisOptions_StemmingDictionary;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_StemmingDictionary != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions.StemmingDictionary = requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_StemmingDictionary;
                requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull = false;
            }
            System.String requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Stopword = null;
            if (cmdletContext.AnalysisOptions_Stopword != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Stopword = cmdletContext.AnalysisOptions_Stopword;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Stopword != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions.Stopwords = requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Stopword;
                requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull     = false;
            }
            System.String requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Synonym = null;
            if (cmdletContext.AnalysisOptions_Synonym != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Synonym = cmdletContext.AnalysisOptions_Synonym;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Synonym != null)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions.Synonyms = requestAnalysisScheme_analysisScheme_AnalysisOptions_analysisOptions_Synonym;
                requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull    = false;
            }
            // determine if requestAnalysisScheme_analysisScheme_AnalysisOptions should be set to null
            if (requestAnalysisScheme_analysisScheme_AnalysisOptionsIsNull)
            {
                requestAnalysisScheme_analysisScheme_AnalysisOptions = null;
            }
            if (requestAnalysisScheme_analysisScheme_AnalysisOptions != null)
            {
                request.AnalysisScheme.AnalysisOptions = requestAnalysisScheme_analysisScheme_AnalysisOptions;
                requestAnalysisSchemeIsNull            = false;
            }
            // determine if request.AnalysisScheme should be set to null
            if (requestAnalysisSchemeIsNull)
            {
                request.AnalysisScheme = null;
            }
            if (cmdletContext.DomainName != null)
            {
                request.DomainName = cmdletContext.DomainName;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }