get method

Future<AccessLevel> get(
  1. String name, {
  2. String? accessLevelFormat,
  3. String? $fields,
})

Gets an access level based on the resource name.

Request parameters:

name - Required. Resource name for the Access Level. Format: accessPolicies/{policy_id}/accessLevels/{access_level_id} Value must have pattern ^accessPolicies/\[^/\]+/accessLevels/\[^/\]+$.

accessLevelFormat - Whether to return BasicLevels in the Cloud Common Expression Language rather than as BasicLevels. Defaults to AS_DEFINED, where Access Levels are returned as BasicLevels or CustomLevels based on how they were created. If set to CEL, all Access Levels are returned as CustomLevels. In the CEL case, BasicLevels are translated to equivalent CustomLevels. Possible string values are:

  • "LEVEL_FORMAT_UNSPECIFIED" : The format was not specified.
  • "AS_DEFINED" : Uses the format the resource was defined in. BasicLevels are returned as BasicLevels, CustomLevels are returned as CustomLevels.
  • "CEL" : Use Cloud Common Expression Language when returning the resource. Both BasicLevels and CustomLevels are returned as CustomLevels.

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

Completes with a AccessLevel.

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

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

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