lookup method

Future<LookupMembershipNameResponse> lookup(
  1. String parent, {
  2. String? memberKey_id,
  3. String? memberKey_namespace,
  4. String? $fields,
})

Looks up the resource name of a Membership by its EntityKey.

Request parameters:

parent - Required. The parent Group resource under which to lookup the Membership name. Must be of the form groups/{group}. Value must have pattern ^groups/\[^/\]+$.

memberKey_id - The ID of the entity. For Google-managed entities, the id should be the email address of an existing group or user. Email addresses need to adhere to name guidelines for users and groups. For external-identity-mapped entities, the id must be a string conforming to the Identity Source's requirements. Must be unique within a namespace.

memberKey_namespace - The namespace in which the entity exists. If not specified, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If specified, the EntityKey represents an external-identity-mapped group. The namespace must correspond to an identity source created in Admin Console and must be in the form of identitysources/{identity_source}.

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

Completes with a LookupMembershipNameResponse.

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<LookupMembershipNameResponse> lookup(
  core.String parent, {
  core.String? memberKey_id,
  core.String? memberKey_namespace,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (memberKey_id != null) 'memberKey.id': [memberKey_id],
    if (memberKey_namespace != null)
      'memberKey.namespace': [memberKey_namespace],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/memberships:lookup';

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