public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonCodeStarNotificationsConfig config = new AmazonCodeStarNotificationsConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonCodeStarNotificationsClient client = new AmazonCodeStarNotificationsClient(creds, config); ListNotificationRulesResponse resp = new ListNotificationRulesResponse(); do { ListNotificationRulesRequest req = new ListNotificationRulesRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListNotificationRules(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.NotificationRules) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
internal virtual ListNotificationRulesResponse ListNotificationRules(ListNotificationRulesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListNotificationRulesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListNotificationRulesResponseUnmarshaller.Instance; return(Invoke <ListNotificationRulesResponse>(request, options)); }
/// <summary> /// Returns a list of the notification rules for an AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListNotificationRules 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 ListNotificationRules service method, as returned by CodeStarNotifications.</returns> /// <exception cref="Amazon.CodeStarNotifications.Model.InvalidNextTokenException"> /// The value for the enumeration token used in the request to return the next batch of /// the results is not valid. /// </exception> /// <exception cref="Amazon.CodeStarNotifications.Model.ValidationException"> /// One or more parameter values are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListNotificationRules">REST API Reference for ListNotificationRules Operation</seealso> public virtual Task <ListNotificationRulesResponse> ListNotificationRulesAsync(ListNotificationRulesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListNotificationRulesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListNotificationRulesResponseUnmarshaller.Instance; return(InvokeAsync <ListNotificationRulesResponse>(request, options, cancellationToken)); }