- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListNotificationRulesCommand
Returns a list of the notification rules for an Amazon Web Services account.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodestarNotificationsClient, ListNotificationRulesCommand } from "@aws-sdk/client-codestar-notifications"; // ES Modules import
// const { CodestarNotificationsClient, ListNotificationRulesCommand } = require("@aws-sdk/client-codestar-notifications"); // CommonJS import
const client = new CodestarNotificationsClient(config);
const input = { // ListNotificationRulesRequest
Filters: [ // ListNotificationRulesFilters
{ // ListNotificationRulesFilter
Name: "EVENT_TYPE_ID" || "CREATED_BY" || "RESOURCE" || "TARGET_ADDRESS", // required
Value: "STRING_VALUE", // required
},
],
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
};
const command = new ListNotificationRulesCommand(input);
const response = await client.send(command);
// { // ListNotificationRulesResult
// NextToken: "STRING_VALUE",
// NotificationRules: [ // NotificationRuleBatch
// { // NotificationRuleSummary
// Id: "STRING_VALUE",
// Arn: "STRING_VALUE",
// },
// ],
// };
ListNotificationRulesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Filters | ListNotificationRulesFilter[] | undefined | The filters to use to return information by service or resource type. For valid values, see ListNotificationRulesFilter. A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements. |
MaxResults | number | undefined | A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100. |
NextToken | string | undefined | An enumeration token that, when provided in a request, returns the next batch of the results. |
ListNotificationRulesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
NextToken | string | undefined | An enumeration token that can be used in a request to return the next batch of the results. |
NotificationRules | NotificationRuleSummary[] | undefined | The list of notification rules for the Amazon Web Services account, by Amazon Resource Name (ARN) and ID. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidNextTokenException | client | The value for the enumeration token used in the request to return the next batch of the results is not valid. |
ValidationException | client | One or more parameter values are not valid. |
CodestarNotificationsServiceException | Base exception class for all service exceptions from CodestarNotifications service. |