lookup method

Future<Container> lookup({
  1. String? destinationId,
  2. String? tagId,
  3. String? $fields,
})

Looks up a Container by destination ID or tag ID.

Request parameters:

destinationId - Destination ID linked to a GTM Container, e.g. AW-123456789. Only one of destination_id or tag_id should be set.

tagId - Tag ID for a GTM Container, e.g. GTM-123456789. Only one of destination_id or tag_id should be set.

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

Completes with a Container.

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<Container> lookup({
  core.String? destinationId,
  core.String? tagId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'destinationId': ?destinationId == null ? null : [destinationId],
    'tagId': ?tagId == null ? null : [tagId],
    'fields': ?$fields == null ? null : [$fields],
  };

  const url_ = 'tagmanager/v2/accounts/containers:lookup';

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