moveTagId method

Future<Container> moveTagId(
  1. String path, {
  2. bool? allowUserPermissionFeatureUpdate,
  3. bool? copySettings,
  4. bool? copyTermsOfService,
  5. bool? copyUsers,
  6. String? tagId,
  7. String? tagName,
  8. String? $fields,
})

Move Tag ID out of a Container.

Request parameters:

path - GTM 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.

copySettings - Whether or not to copy tag settings from this tag to the new tag.

copyTermsOfService - Must be set to true to accept all terms of service agreements copied from the current tag to the newly created tag. If this bit is false, the operation will fail.

copyUsers - Whether or not to copy users from this tag to the new tag.

tagId - Tag ID to be removed from the current Container.

tagName - The name for the newly created tag.

$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> moveTagId(
  core.String path, {
  core.bool? allowUserPermissionFeatureUpdate,
  core.bool? copySettings,
  core.bool? copyTermsOfService,
  core.bool? copyUsers,
  core.String? tagId,
  core.String? tagName,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (allowUserPermissionFeatureUpdate != null)
      'allowUserPermissionFeatureUpdate': [
        '${allowUserPermissionFeatureUpdate}'
      ],
    if (copySettings != null) 'copySettings': ['${copySettings}'],
    if (copyTermsOfService != null)
      'copyTermsOfService': ['${copyTermsOfService}'],
    if (copyUsers != null) 'copyUsers': ['${copyUsers}'],
    if (tagId != null) 'tagId': [tagId],
    if (tagName != null) 'tagName': [tagName],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'tagmanager/v2/' + core.Uri.encodeFull('$path') + ':move_tag_id';

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