public object Execute(ExecutorContext context)
 {
     var cmdletContext = context as CmdletContext;
     // create request
     var request = new Amazon.ConnectWisdomService.Model.SearchContentRequest();
     
     if (cmdletContext.KnowledgeBaseId != null)
     {
         request.KnowledgeBaseId = cmdletContext.KnowledgeBaseId;
     }
     if (cmdletContext.MaxResult != null)
     {
         request.MaxResults = cmdletContext.MaxResult.Value;
     }
     if (cmdletContext.NextToken != null)
     {
         request.NextToken = cmdletContext.NextToken;
     }
     
      // populate SearchExpression
     var requestSearchExpressionIsNull = true;
     request.SearchExpression = new Amazon.ConnectWisdomService.Model.SearchExpression();
     List<Amazon.ConnectWisdomService.Model.Filter> requestSearchExpression_searchExpression_Filter = null;
     if (cmdletContext.SearchExpression_Filter != null)
     {
         requestSearchExpression_searchExpression_Filter = cmdletContext.SearchExpression_Filter;
     }
     if (requestSearchExpression_searchExpression_Filter != null)
     {
         request.SearchExpression.Filters = requestSearchExpression_searchExpression_Filter;
         requestSearchExpressionIsNull = false;
     }
      // determine if request.SearchExpression should be set to null
     if (requestSearchExpressionIsNull)
     {
         request.SearchExpression = null;
     }
     
     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;
 }
 private Amazon.ConnectWisdomService.Model.SearchContentResponse CallAWSServiceOperation(IAmazonConnectWisdomService client, Amazon.ConnectWisdomService.Model.SearchContentRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Wisdom Service", "SearchContent");
     try
     {
         #if DESKTOP
         return client.SearchContent(request);
         #elif CORECLR
         return client.SearchContentAsync(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;
     }
 }
Esempio n. 3
0
 internal SearchContentPaginator(IAmazonConnectWisdomService client, SearchContentRequest request)
 {
     this._client  = client;
     this._request = request;
 }
Esempio n. 4
0
 /// <summary>
 /// Paginator for SearchContent operation
 ///</summary>
 public ISearchContentPaginator SearchContent(SearchContentRequest request)
 {
     return(new SearchContentPaginator(this.client, request));
 }