revert method

Future<RevertBuiltInVariableResponse> revert(
  1. String path, {
  2. String? type,
  3. String? $fields,
})

Reverts changes to a GTM Built-In Variables in a GTM Workspace.

Request parameters:

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

type - The type of built-in variable to revert. Possible string values are:

  • "builtInVariableTypeUnspecified"
  • "pageUrl"
  • "pageHostname"
  • "pagePath"
  • "referrer"
  • "event" : For web or mobile.
  • "clickElement"
  • "clickClasses"
  • "clickId"
  • "clickTarget"
  • "clickUrl"
  • "clickText"
  • "firstPartyServingUrl"
  • "formElement"
  • "formClasses"
  • "formId"
  • "formTarget"
  • "formUrl"
  • "formText"
  • "errorMessage"
  • "errorUrl"
  • "errorLine"
  • "newHistoryUrl"
  • "oldHistoryUrl"
  • "newHistoryFragment"
  • "oldHistoryFragment"
  • "newHistoryState"
  • "oldHistoryState"
  • "historySource"
  • "containerVersion" : For web or mobile.
  • "debugMode"
  • "randomNumber" : For web or mobile.
  • "containerId" : For web or mobile.
  • "appId"
  • "appName"
  • "appVersionCode"
  • "appVersionName"
  • "language"
  • "osVersion"
  • "platform"
  • "sdkVersion"
  • "deviceName"
  • "resolution"
  • "advertiserId"
  • "advertisingTrackingEnabled"
  • "htmlId"
  • "environmentName"
  • "ampBrowserLanguage"
  • "ampCanonicalPath"
  • "ampCanonicalUrl"
  • "ampCanonicalHost"
  • "ampReferrer"
  • "ampTitle"
  • "ampClientId"
  • "ampClientTimezone"
  • "ampClientTimestamp"
  • "ampClientScreenWidth"
  • "ampClientScreenHeight"
  • "ampClientScrollX"
  • "ampClientScrollY"
  • "ampClientMaxScrollX"
  • "ampClientMaxScrollY"
  • "ampTotalEngagedTime"
  • "ampPageViewId"
  • "ampPageLoadTime"
  • "ampPageDownloadTime"
  • "ampGtmEvent"
  • "eventName"
  • "firebaseEventParameterCampaign"
  • "firebaseEventParameterCampaignAclid"
  • "firebaseEventParameterCampaignAnid"
  • "firebaseEventParameterCampaignClickTimestamp"
  • "firebaseEventParameterCampaignContent"
  • "firebaseEventParameterCampaignCp1"
  • "firebaseEventParameterCampaignGclid"
  • "firebaseEventParameterCampaignSource"
  • "firebaseEventParameterCampaignTerm"
  • "firebaseEventParameterCurrency"
  • "firebaseEventParameterDynamicLinkAcceptTime"
  • "firebaseEventParameterDynamicLinkLinkid"
  • "firebaseEventParameterNotificationMessageDeviceTime"
  • "firebaseEventParameterNotificationMessageId"
  • "firebaseEventParameterNotificationMessageName"
  • "firebaseEventParameterNotificationMessageTime"
  • "firebaseEventParameterNotificationTopic"
  • "firebaseEventParameterPreviousAppVersion"
  • "firebaseEventParameterPreviousOsVersion"
  • "firebaseEventParameterPrice"
  • "firebaseEventParameterProductId"
  • "firebaseEventParameterQuantity"
  • "firebaseEventParameterValue"
  • "videoProvider"
  • "videoUrl"
  • "videoTitle"
  • "videoDuration"
  • "videoPercent"
  • "videoVisible"
  • "videoStatus"
  • "videoCurrentTime"
  • "scrollDepthThreshold"
  • "scrollDepthUnits"
  • "scrollDepthDirection"
  • "elementVisibilityRatio"
  • "elementVisibilityTime"
  • "elementVisibilityFirstTime"
  • "elementVisibilityRecentTime"
  • "requestPath"
  • "requestMethod"
  • "clientName"
  • "queryString"
  • "serverPageLocationUrl"
  • "serverPageLocationPath"
  • "serverPageLocationHostname"
  • "visitorRegion"

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

Completes with a RevertBuiltInVariableResponse.

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<RevertBuiltInVariableResponse> revert(
  core.String path, {
  core.String? type,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (type != null) 'type': [type],
    if ($fields != null) 'fields': [$fields],
  };

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

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