1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18namespace Google\Service\TagManager\Resource; 19 20use Google\Service\TagManager\ListTriggersResponse; 21use Google\Service\TagManager\RevertTriggerResponse; 22use Google\Service\TagManager\Trigger; 23 24/** 25 * The "triggers" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $tagmanagerService = new Google\Service\TagManager(...); 29 * $triggers = $tagmanagerService->triggers; 30 * </code> 31 */ 32class AccountsContainersWorkspacesTriggers extends \Google\Service\Resource 33{ 34 /** 35 * Creates a GTM Trigger. (triggers.create) 36 * 37 * @param string $parent GTM Workspaces's API relative path. Example: 38 * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} 39 * @param Trigger $postBody 40 * @param array $optParams Optional parameters. 41 * @return Trigger 42 */ 43 public function create($parent, Trigger $postBody, $optParams = []) 44 { 45 $params = ['parent' => $parent, 'postBody' => $postBody]; 46 $params = array_merge($params, $optParams); 47 return $this->call('create', [$params], Trigger::class); 48 } 49 /** 50 * Deletes a GTM Trigger. (triggers.delete) 51 * 52 * @param string $path GTM Trigger's API relative path. Example: accounts/{accou 53 * nt_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_ 54 * id} 55 * @param array $optParams Optional parameters. 56 */ 57 public function delete($path, $optParams = []) 58 { 59 $params = ['path' => $path]; 60 $params = array_merge($params, $optParams); 61 return $this->call('delete', [$params]); 62 } 63 /** 64 * Gets a GTM Trigger. (triggers.get) 65 * 66 * @param string $path GTM Trigger's API relative path. Example: accounts/{accou 67 * nt_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_ 68 * id} 69 * @param array $optParams Optional parameters. 70 * @return Trigger 71 */ 72 public function get($path, $optParams = []) 73 { 74 $params = ['path' => $path]; 75 $params = array_merge($params, $optParams); 76 return $this->call('get', [$params], Trigger::class); 77 } 78 /** 79 * Lists all GTM Triggers of a Container. 80 * (triggers.listAccountsContainersWorkspacesTriggers) 81 * 82 * @param string $parent GTM Workspaces's API relative path. Example: 83 * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} 84 * @param array $optParams Optional parameters. 85 * 86 * @opt_param string pageToken Continuation token for fetching the next page of 87 * results. 88 * @return ListTriggersResponse 89 */ 90 public function listAccountsContainersWorkspacesTriggers($parent, $optParams = []) 91 { 92 $params = ['parent' => $parent]; 93 $params = array_merge($params, $optParams); 94 return $this->call('list', [$params], ListTriggersResponse::class); 95 } 96 /** 97 * Reverts changes to a GTM Trigger in a GTM Workspace. (triggers.revert) 98 * 99 * @param string $path GTM Trigger's API relative path. Example: accounts/{accou 100 * nt_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_ 101 * id} 102 * @param array $optParams Optional parameters. 103 * 104 * @opt_param string fingerprint When provided, this fingerprint must match the 105 * fingerprint of the trigger in storage. 106 * @return RevertTriggerResponse 107 */ 108 public function revert($path, $optParams = []) 109 { 110 $params = ['path' => $path]; 111 $params = array_merge($params, $optParams); 112 return $this->call('revert', [$params], RevertTriggerResponse::class); 113 } 114 /** 115 * Updates a GTM Trigger. (triggers.update) 116 * 117 * @param string $path GTM Trigger's API relative path. Example: accounts/{accou 118 * nt_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_ 119 * id} 120 * @param Trigger $postBody 121 * @param array $optParams Optional parameters. 122 * 123 * @opt_param string fingerprint When provided, this fingerprint must match the 124 * fingerprint of the trigger in storage. 125 * @return Trigger 126 */ 127 public function update($path, Trigger $postBody, $optParams = []) 128 { 129 $params = ['path' => $path, 'postBody' => $postBody]; 130 $params = array_merge($params, $optParams); 131 return $this->call('update', [$params], Trigger::class); 132 } 133} 134 135// Adding a class alias for backwards compatibility with the previous class name. 136class_alias(AccountsContainersWorkspacesTriggers::class, 'Google_Service_TagManager_Resource_AccountsContainersWorkspacesTriggers'); 137