list method

Future<ListClientUserInvitationsResponse> list(
  1. String accountId,
  2. String clientAccountId, {
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Lists all the client users invitations for a client with a given account ID.

Request parameters:

accountId - Numerical account ID of the client's sponsor buyer. (required)

clientAccountId - Numerical account ID of the client buyer to list invitations for. (required) You must either specify a string representation of a numerical account identifier or the - character to list all the invitations for all the clients of a given sponsor buyer.

pageSize - Requested page size. Server may return fewer clients than requested. If unspecified, server will pick an appropriate default.

pageToken - A token identifying a page of results the server should return. Typically, this is the value of ListClientUserInvitationsResponse.nextPageToken returned from the previous call to the clients.invitations.list method.

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

Completes with a ListClientUserInvitationsResponse.

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<ListClientUserInvitationsResponse> list(
  core.String accountId,
  core.String clientAccountId, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2beta1/accounts/' +
      commons.escapeVariable('$accountId') +
      '/clients/' +
      commons.escapeVariable('$clientAccountId') +
      '/invitations';

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