retrieve method

Future<RetrieveInsightsResponse> retrieve(
  1. RetrieveInsightsRequest request,
  2. String parent, {
  3. String? $fields,
})

Retrieves marketing data insights for a given user list.

This feature is only available to data partners. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId} * linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

request - The metadata request object.

Request parameters:

parent - Required. The parent account that owns the user list. Format: accountTypes/{account_type}/accounts/{account} Value must have pattern ^accountTypes/\[^/\]+/accounts/\[^/\]+$.

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

Completes with a RetrieveInsightsResponse.

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<RetrieveInsightsResponse> retrieve(
  RetrieveInsightsRequest request,
  core.String parent, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    'fields': ?$fields == null ? null : [$fields],
  };

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

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