get method

Future<ContactGroup> get(
  1. String resourceName, {
  2. String? groupFields,
  3. int? maxMembers,
  4. String? $fields,
})

Get a specific contact group owned by the authenticated user by specifying a contact group resource name.

Request parameters:

resourceName - Required. The resource name of the contact group to get. Value must have pattern ^contactGroups/\[^/\]+$.

groupFields - Optional. A field mask to restrict which fields on the group are returned. Defaults to metadata, groupType, memberCount, and name if not set or set to empty. Valid fields are: * clientData * groupType * memberCount * metadata * name

maxMembers - Optional. Specifies the maximum number of members to return. Defaults to 0 if not set, which will return zero members.

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

Completes with a ContactGroup.

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

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

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