Returns a list of the notification rules for an Amazon Web Services account.
Parameters:
-
filters
(Optional[ListNotificationRulesFilters], default:
None
)
–
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.
-
next_token
(Optional[NextToken], default:
None
)
–
An enumeration token that, when provided in a request, returns the next batch of the results.
-
max_results
(Optional[MaxResults], default:
None
)
–
A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.
Raises:
Source code in docs_src/capo_codestar_notifications/_services/codestarnotifications.py
| def list_notification_rules(
self,
*,
config_overrides: Optional[codestarnotificationsClientConfig] = None,
filters: Optional[
"capo_codestar_notifications.types.list_notification_rules_filters.ListNotificationRulesFilters"
] = None,
next_token: Optional[
"capo_codestar_notifications.types.next_token.NextToken"
] = None,
max_results: Optional[
"capo_codestar_notifications.types.max_results.MaxResults"
] = None,
) -> "capo_codestar_notifications.types.list_notification_rules_result.ListNotificationRulesResult":
"""<p>Returns a list of the notification rules for an Amazon Web Services account.</p>
Args:
filters: <p>The filters to use to return information by service or resource type. For valid values, see <a>ListNotificationRulesFilter</a>.</p> <note> <p>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.</p> </note>
next_token: <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
max_results: <p>A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.</p>
Raises:
capo_codestar_notifications.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The value for the enumeration token used in the request to return the next batch of the results is not valid. </p>
capo_codestar_notifications.errors.validation_exception.ValidationException: <p>One or more parameter values are not valid.</p>
capo_codestar_notifications.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_codestar_notifications.types.list_notification_rules_request.ListNotificationRulesRequest]",
) -> OperationResponse[
"capo_codestar_notifications.types.list_notification_rules_result.ListNotificationRulesResult"
]:
import capo_codestar_notifications._operations.code_star_notifications_20191015.list_notification_rules
output, http_response = (
capo_codestar_notifications._operations.code_star_notifications_20191015.list_notification_rules.list_notification_rules(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListNotificationRules")
)
input_: capo_codestar_notifications.types.list_notification_rules_request.ListNotificationRulesRequest = {}
if filters is not None:
input_["filters"] = filters
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|