list method

Future<CalendarResources> list(
  1. String customer, {
  2. int? maxResults,
  3. String? orderBy,
  4. String? pageToken,
  5. String? query,
  6. String? $fields,
})

Retrieves a list of calendar resources for an account.

Request parameters:

customer - The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID.

maxResults - Maximum number of results to return. Value must be between "1" and "500".

orderBy - Field(s) to sort results by in either ascending or descending order. Supported fields include resourceId, resourceName, capacity, buildingId, and floorName. If no order is specified, defaults to ascending. Should be of the form "field [asc|desc], field [asc|desc], ...". For example buildingId, capacity desc would return results sorted first by buildingId in ascending order then by capacity in descending order.

pageToken - Token to specify the next page in the list.

query - String query used to filter results. Should be of the form "field operator value" where field can be any of supported fields and operators can be any of supported operations. Operators include '=' for exact match, '!=' for mismatch and ':' for prefix match or HAS match where applicable. For prefix match, the value should always be followed by a *. Logical operators NOT and AND are supported (in this order of precedence). Supported fields include generatedResourceName, name, buildingId, floor_name, capacity, featureInstances.feature.name, resourceEmail, resourceCategory. For example buildingId=US-NYC-9TH AND featureInstances.feature.name:Phone.

$fields - Selector specifying which fields to include in a partial response.

Completes with a CalendarResources.

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<CalendarResources> list(
  core.String customer, {
  core.int? maxResults,
  core.String? orderBy,
  core.String? pageToken,
  core.String? query,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageToken != null) 'pageToken': [pageToken],
    if (query != null) 'query': [query],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'admin/directory/v1/customer/' +
      commons.escapeVariable('$customer') +
      '/resources/calendars';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return CalendarResources.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}