protected override void ProcessRecord() { base.ProcessRecord(); ListRecommendationsRequest request; try { request = new ListRecommendationsRequest { WaasPolicyId = WaasPolicyId, OpcRequestId = OpcRequestId, RecommendedAction = RecommendedAction, Limit = Limit, Page = Page }; IEnumerable <ListRecommendationsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.Items, true); } if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null) { WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources."); } FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
protected override void ProcessRecord() { base.ProcessRecord(); ListRecommendationsRequest request; try { request = new ListRecommendationsRequest { CompartmentId = CompartmentId, SortOrder = SortOrder, SortBy = SortBy, TargetId = TargetId, CompartmentIdInSubtree = CompartmentIdInSubtree, AccessLevel = AccessLevel, LifecycleState = LifecycleState, LifecycleDetail = LifecycleDetail, Limit = Limit, Page = Page, OpcRequestId = OpcRequestId }; IEnumerable <ListRecommendationsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.RecommendationSummaryCollection, true); } FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
protected override void ProcessRecord() { base.ProcessRecord(); ListRecommendationsRequest request; try { request = new ListRecommendationsRequest { WaasPolicyId = WaasPolicyId, OpcRequestId = OpcRequestId, RecommendedAction = RecommendedAction, Limit = Limit, Page = Page }; IEnumerable <ListRecommendationsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.Items, true); } FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// Returns the list of all recommendations for a completed code review. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRecommendations 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 ListRecommendations service method, as returned by CodeGuruReviewer.</returns> /// <exception cref="Amazon.CodeGuruReviewer.Model.AccessDeniedException"> /// You do not have sufficient access to perform this action. /// </exception> /// <exception cref="Amazon.CodeGuruReviewer.Model.InternalServerException"> /// The server encountered an internal error and is unable to complete the request. /// </exception> /// <exception cref="Amazon.CodeGuruReviewer.Model.ResourceNotFoundException"> /// The resource specified in the request was not found. /// </exception> /// <exception cref="Amazon.CodeGuruReviewer.Model.ThrottlingException"> /// The request was denied due to request throttling. /// </exception> /// <exception cref="Amazon.CodeGuruReviewer.Model.ValidationException"> /// The input fails to satisfy the specified constraints. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/ListRecommendations">REST API Reference for ListRecommendations Operation</seealso> public virtual Task <ListRecommendationsResponse> ListRecommendationsAsync(ListRecommendationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListRecommendationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRecommendationsResponseUnmarshaller.Instance; return(InvokeAsync <ListRecommendationsResponse>(request, options, cancellationToken)); }
internal virtual ListRecommendationsResponse ListRecommendations(ListRecommendationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListRecommendationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRecommendationsResponseUnmarshaller.Instance; return(Invoke <ListRecommendationsResponse>(request, options)); }
/// <summary>Snippet for ListRecommendations</summary> public async Task ListRecommendationsAsync_RequestObject() { // Snippet: ListRecommendationsAsync(ListRecommendationsRequest, CallSettings) // Create client RecommenderClient recommenderClient = await RecommenderClient.CreateAsync(); // Initialize request argument(s) ListRecommendationsRequest request = new ListRecommendationsRequest { ParentAsRecommenderName = new RecommenderName("[PROJECT]", "[LOCATION]", "[RECOMMENDER]"), Filter = "", }; // Make the request PagedAsyncEnumerable <ListRecommendationsResponse, Recommendation> response = recommenderClient.ListRecommendationsAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Recommendation item) => { // Do something with each item Console.WriteLine(item); }); // Or iterate over pages (of server-defined size), performing one RPC per page await response.AsRawResponses().ForEachAsync((ListRecommendationsResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Recommendation item in page) { // Do something with each item Console.WriteLine(item); } }); // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <Recommendation> singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (Recommendation item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
public ListRecommendationsResponse InvokeListRecommendations() { // Create a request. ListRecommendationsRequest request = new ListRecommendationsRequest(); string marketplaceId = "example"; request.MarketplaceId = marketplaceId; string mwsAuthToken = "example"; request.MWSAuthToken = mwsAuthToken; string sellerId = "example"; request.SellerId = sellerId; string recommendationCategory = "example"; request.RecommendationCategory = recommendationCategory; List <CategoryQuery> categoryQueryList = new List <CategoryQuery>(); request.CategoryQueryList = categoryQueryList; return(this.client.ListRecommendations(request)); }
protected override void ProcessRecord() { base.ProcessRecord(); ListRecommendationsRequest request; try { request = new ListRecommendationsRequest { CompartmentId = CompartmentId, CompartmentIdInSubtree = CompartmentIdInSubtree, CategoryId = CategoryId, Name = Name, Limit = Limit, Page = Page, SortOrder = SortOrder, SortBy = SortBy, LifecycleState = LifecycleState, Status = Status, OpcRequestId = OpcRequestId }; IEnumerable <ListRecommendationsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.RecommendationCollection, true); } if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null) { WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources."); } FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
public ListRecommendationsResponse ListRecommendations(ListRecommendationsRequest request) { return(newResponse <ListRecommendationsResponse>()); }
/// <summary> /// Creates a new enumerable which will iterate over the RecommendationSummary objects /// contained in responses from the ListRecommendations operation. This enumerable will fetch more data from the server as needed. /// </summary> /// <param name="request">The request object containing the details to send</param> /// <param name="retryConfiguration">The configuration for retrying, may be null</param> /// <param name="cancellationToken">The cancellation token object</param> /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns> public IEnumerable <RecommendationSummary> ListRecommendationsRecordEnumerator(ListRecommendationsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { return(new Common.Utils.ResponseRecordEnumerable <ListRecommendationsRequest, ListRecommendationsResponse, RecommendationSummary>( response => response.OpcNextPage, input => { if (!string.IsNullOrEmpty(input)) { request.Page = input; } return request; }, request => client.ListRecommendations(request, retryConfiguration, cancellationToken), response => response.RecommendationCollection.Items )); }
public ListRecommendationsResponse ListRecommendations(ListRecommendationsRequest request) { return(connection.Call( new MWSRecommendationsSectionServiceClient.Request <ListRecommendationsResponse>("ListRecommendations", typeof(ListRecommendationsResponse), servicePath), request)); }