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\ListTagsResponse;
21use Google\Service\TagManager\RevertTagResponse;
22use Google\Service\TagManager\Tag;
23
24/**
25 * The "tags" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $tagmanagerService = new Google\Service\TagManager(...);
29 *   $tags = $tagmanagerService->tags;
30 *  </code>
31 */
32class AccountsContainersWorkspacesTags extends \Google\Service\Resource
33{
34  /**
35   * Creates a GTM Tag. (tags.create)
36   *
37   * @param string $parent GTM Workspace's API relative path. Example:
38   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
39   * @param Tag $postBody
40   * @param array $optParams Optional parameters.
41   * @return Tag
42   */
43  public function create($parent, Tag $postBody, $optParams = [])
44  {
45    $params = ['parent' => $parent, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], Tag::class);
48  }
49  /**
50   * Deletes a GTM Tag. (tags.delete)
51   *
52   * @param string $path GTM Tag's API relative path. Example: accounts/{account_i
53   * d}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}
54   * @param array $optParams Optional parameters.
55   */
56  public function delete($path, $optParams = [])
57  {
58    $params = ['path' => $path];
59    $params = array_merge($params, $optParams);
60    return $this->call('delete', [$params]);
61  }
62  /**
63   * Gets a GTM Tag. (tags.get)
64   *
65   * @param string $path GTM Tag's API relative path. Example: accounts/{account_i
66   * d}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}
67   * @param array $optParams Optional parameters.
68   * @return Tag
69   */
70  public function get($path, $optParams = [])
71  {
72    $params = ['path' => $path];
73    $params = array_merge($params, $optParams);
74    return $this->call('get', [$params], Tag::class);
75  }
76  /**
77   * Lists all GTM Tags of a Container.
78   * (tags.listAccountsContainersWorkspacesTags)
79   *
80   * @param string $parent GTM Workspace's API relative path. Example:
81   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
82   * @param array $optParams Optional parameters.
83   *
84   * @opt_param string pageToken Continuation token for fetching the next page of
85   * results.
86   * @return ListTagsResponse
87   */
88  public function listAccountsContainersWorkspacesTags($parent, $optParams = [])
89  {
90    $params = ['parent' => $parent];
91    $params = array_merge($params, $optParams);
92    return $this->call('list', [$params], ListTagsResponse::class);
93  }
94  /**
95   * Reverts changes to a GTM Tag in a GTM Workspace. (tags.revert)
96   *
97   * @param string $path GTM Tag's API relative path. Example: accounts/{account_i
98   * d}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}
99   * @param array $optParams Optional parameters.
100   *
101   * @opt_param string fingerprint When provided, this fingerprint must match the
102   * fingerprint of thetag in storage.
103   * @return RevertTagResponse
104   */
105  public function revert($path, $optParams = [])
106  {
107    $params = ['path' => $path];
108    $params = array_merge($params, $optParams);
109    return $this->call('revert', [$params], RevertTagResponse::class);
110  }
111  /**
112   * Updates a GTM Tag. (tags.update)
113   *
114   * @param string $path GTM Tag's API relative path. Example: accounts/{account_i
115   * d}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}
116   * @param Tag $postBody
117   * @param array $optParams Optional parameters.
118   *
119   * @opt_param string fingerprint When provided, this fingerprint must match the
120   * fingerprint of the tag in storage.
121   * @return Tag
122   */
123  public function update($path, Tag $postBody, $optParams = [])
124  {
125    $params = ['path' => $path, 'postBody' => $postBody];
126    $params = array_merge($params, $optParams);
127    return $this->call('update', [$params], Tag::class);
128  }
129}
130
131// Adding a class alias for backwards compatibility with the previous class name.
132class_alias(AccountsContainersWorkspacesTags::class, 'Google_Service_TagManager_Resource_AccountsContainersWorkspacesTags');
133