get method

Future<GoogleAppsDriveLabelsV2Label> get(
  1. String name, {
  2. String? languageCode,
  3. bool? useAdminAccess,
  4. String? view,
  5. String? $fields,
})

Get a label by its resource name.

Resource name may be any of: * labels/{id} - See labels/{id}@latest * labels/{id}@latest - Gets the latest revision of the label. * labels/{id}@published - Gets the current published revision of the label. * labels/{id}@{revision_id} - Gets the label at the specified revision ID.

Request parameters:

name - Required. Label resource name. May be any of: * labels/{id} (equivalent to labels/{id}@latest) * labels/{id}@latest * labels/{id}@published * labels/{id}@{revision_id} Value must have pattern ^labels/\[^/\]+$.

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

useAdminAccess - Set to true in order to use the user's admin credentials. The server verifies that the user is an admin for the label before allowing access.

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 GoogleAppsDriveLabelsV2Label.

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<GoogleAppsDriveLabelsV2Label> get(
  core.String name, {
  core.String? languageCode,
  core.bool? useAdminAccess,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (languageCode != null) 'languageCode': [languageCode],
    if (useAdminAccess != null) 'useAdminAccess': ['${useAdminAccess}'],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$name');

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