internal ListIntentsPaginator(IAmazonLexModelsV2 client, ListIntentsRequest request) { this._client = client; this._request = request; }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.LexModelsV2.Model.ListIntentsRequest(); if (cmdletContext.BotId != null) { request.BotId = cmdletContext.BotId; } if (cmdletContext.BotVersion != null) { request.BotVersion = cmdletContext.BotVersion; } if (cmdletContext.Filter != null) { request.Filters = cmdletContext.Filter; } if (cmdletContext.LocaleId != null) { request.LocaleId = cmdletContext.LocaleId; } if (cmdletContext.MaxResult != null) { request.MaxResults = cmdletContext.MaxResult.Value; } if (cmdletContext.NextToken != null) { request.NextToken = cmdletContext.NextToken; } // populate SortBy var requestSortByIsNull = true; request.SortBy = new Amazon.LexModelsV2.Model.IntentSortBy(); Amazon.LexModelsV2.IntentSortAttribute requestSortBy_sortBy_Attribute = null; if (cmdletContext.SortBy_Attribute != null) { requestSortBy_sortBy_Attribute = cmdletContext.SortBy_Attribute; } if (requestSortBy_sortBy_Attribute != null) { request.SortBy.Attribute = requestSortBy_sortBy_Attribute; requestSortByIsNull = false; } Amazon.LexModelsV2.SortOrder requestSortBy_sortBy_Order = null; if (cmdletContext.SortBy_Order != null) { requestSortBy_sortBy_Order = cmdletContext.SortBy_Order; } if (requestSortBy_sortBy_Order != null) { request.SortBy.Order = requestSortBy_sortBy_Order; requestSortByIsNull = false; } // determine if request.SortBy should be set to null if (requestSortByIsNull) { request.SortBy = 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.LexModelsV2.Model.ListIntentsResponse CallAWSServiceOperation(IAmazonLexModelsV2 client, Amazon.LexModelsV2.Model.ListIntentsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Lex Model Building V2", "ListIntents"); try { #if DESKTOP return(client.ListIntents(request)); #elif CORECLR return(client.ListIntentsAsync(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; } }
/// <summary> /// Paginator for ListIntents operation ///</summary> public IListIntentsPaginator ListIntents(ListIntentsRequest request) { return(new ListIntentsPaginator(this.client, request)); }