link method

Future<Destination> link(
  1. String parent, {
  2. bool? allowUserPermissionFeatureUpdate,
  3. String? destinationId,
  4. String? $fields,
})

Adds a Destination to this Container and removes it from the Container to which it is currently linked.

Request parameters:

parent - GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} Value must have pattern ^accounts/\[^/\]+/containers/\[^/\]+$.

allowUserPermissionFeatureUpdate - Must be set to true to allow features.user_permissions to change from false to true. If this operation causes an update but this bit is false, the operation will fail.

destinationId - Destination ID to be linked to the current container.

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

Completes with a Destination.

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<Destination> link(
  core.String parent, {
  core.bool? allowUserPermissionFeatureUpdate,
  core.String? destinationId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (allowUserPermissionFeatureUpdate != null)
      'allowUserPermissionFeatureUpdate': [
        '${allowUserPermissionFeatureUpdate}'
      ],
    if (destinationId != null) 'destinationId': [destinationId],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'tagmanager/v2/' +
      core.Uri.encodeFull('$parent') +
      '/destinations:link';

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