list method
Lists the notification channels that have been created for the project.
To list the types of notification channels that are supported, use the ListNotificationChannelDescriptors method.
Request parameters:
name
- Required. The project
(https://cloud.google.com/monitoring/api/v3#project_name) on which to
execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER] This
names the container in which to look for the notification channels; it
does not name a specific channel. To query a specific channel by REST
resource name, use the GetNotificationChannel operation.
Value must have pattern ^projects/\[^/\]+$
.
filter
- If provided, this field specifies the criteria that must be met
by notification channels to be included in the response.For more details,
see sorting and filtering
(https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
orderBy
- A comma-separated list of fields by which to sort the result.
Supports the same set of fields as in filter. Entries can be prefixed with
a minus sign to sort in descending rather than ascending order.For more
details, see sorting and filtering
(https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
pageSize
- The maximum number of results to return in a single response.
If not set to a positive number, a reasonable value will be chosen by the
service.
pageToken
- If non-empty, page_token must contain a value returned as
the next_page_token in a previous response to request the next set of
results.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListNotificationChannelsResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<ListNotificationChannelsResponse> list(
core.String name, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (orderBy != null) 'orderBy': [orderBy],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v3/' + core.Uri.encodeFull('$name') + '/notificationChannels';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListNotificationChannelsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}