list method

Future<GoogleAppsDriveLabelsV2ListLabelsResponse> list({
  1. String? customer,
  2. String? languageCode,
  3. String? minimumRole,
  4. int? pageSize,
  5. String? pageToken,
  6. bool? publishedOnly,
  7. bool? useAdminAccess,
  8. String? view,
  9. String? $fields,
})

List labels.

Request parameters:

customer - The customer to scope this list request to. For example: "customers/abcd1234". If unset, will return all labels within the current customer.

languageCode - The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used.

minimumRole - Specifies the level of access the user must have on the returned Labels. The minimum role a user must have on a label. Defaults to READER. Possible string values are:

  • "LABEL_ROLE_UNSPECIFIED" : Unknown role.
  • "READER" : A reader can read the label and associated metadata applied to Drive items.
  • "APPLIER" : An applier can write associated metadata on Drive items in which they also have write access to. Implies READER.
  • "ORGANIZER" : An organizer can pin this label in shared drives they manage and add new appliers to the label.
  • "EDITOR" : Editors can make any update including deleting the label which also deletes the associated Drive item metadata. Implies APPLIER.

pageSize - Maximum number of labels to return per page. Default: 50. Max: 200.

pageToken - The token of the page to return.

publishedOnly - Whether to include only published labels in the results.

  • When true, only the current published label revisions are returned. Disabled labels are included. Returned label resource names reference the published revision (labels/{id}/{revision_id}). * When false, the current label revisions are returned, which might not be published. Returned label resource names don't reference a specific revision (labels/{id}).

useAdminAccess - Set to true in order to use the user's admin credentials. This will return all Labels within the customer.

view - When specified, only certain fields belonging to the indicated view are returned. Possible string values are:

  • "LABEL_VIEW_BASIC" : Implies the field mask: name,id,revision_id,label_type,properties.*
  • "LABEL_VIEW_FULL" : All possible fields.

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

Completes with a GoogleAppsDriveLabelsV2ListLabelsResponse.

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<GoogleAppsDriveLabelsV2ListLabelsResponse> list({
  core.String? customer,
  core.String? languageCode,
  core.String? minimumRole,
  core.int? pageSize,
  core.String? pageToken,
  core.bool? publishedOnly,
  core.bool? useAdminAccess,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (customer != null) 'customer': [customer],
    if (languageCode != null) 'languageCode': [languageCode],
    if (minimumRole != null) 'minimumRole': [minimumRole],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (publishedOnly != null) 'publishedOnly': ['${publishedOnly}'],
    if (useAdminAccess != null) 'useAdminAccess': ['${useAdminAccess}'],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v2/labels';

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