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\Folder;
21use Google\Service\TagManager\FolderEntities;
22use Google\Service\TagManager\ListFoldersResponse;
23use Google\Service\TagManager\RevertFolderResponse;
24
25/**
26 * The "folders" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $tagmanagerService = new Google\Service\TagManager(...);
30 *   $folders = $tagmanagerService->folders;
31 *  </code>
32 */
33class AccountsContainersWorkspacesFolders extends \Google\Service\Resource
34{
35  /**
36   * Creates a GTM Folder. (folders.create)
37   *
38   * @param string $parent GTM Workspace's API relative path. Example:
39   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
40   * @param Folder $postBody
41   * @param array $optParams Optional parameters.
42   * @return Folder
43   */
44  public function create($parent, Folder $postBody, $optParams = [])
45  {
46    $params = ['parent' => $parent, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('create', [$params], Folder::class);
49  }
50  /**
51   * Deletes a GTM Folder. (folders.delete)
52   *
53   * @param string $path GTM Folder's API relative path. Example: accounts/{accoun
54   * t_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_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   * List all entities in a GTM Folder. (folders.entities)
65   *
66   * @param string $path GTM Folder's API relative path. Example: accounts/{accoun
67   * t_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}
68   * @param array $optParams Optional parameters.
69   *
70   * @opt_param string pageToken Continuation token for fetching the next page of
71   * results.
72   * @return FolderEntities
73   */
74  public function entities($path, $optParams = [])
75  {
76    $params = ['path' => $path];
77    $params = array_merge($params, $optParams);
78    return $this->call('entities', [$params], FolderEntities::class);
79  }
80  /**
81   * Gets a GTM Folder. (folders.get)
82   *
83   * @param string $path GTM Folder's API relative path. Example: accounts/{accoun
84   * t_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}
85   * @param array $optParams Optional parameters.
86   * @return Folder
87   */
88  public function get($path, $optParams = [])
89  {
90    $params = ['path' => $path];
91    $params = array_merge($params, $optParams);
92    return $this->call('get', [$params], Folder::class);
93  }
94  /**
95   * Lists all GTM Folders of a Container.
96   * (folders.listAccountsContainersWorkspacesFolders)
97   *
98   * @param string $parent GTM Workspace's API relative path. Example:
99   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
100   * @param array $optParams Optional parameters.
101   *
102   * @opt_param string pageToken Continuation token for fetching the next page of
103   * results.
104   * @return ListFoldersResponse
105   */
106  public function listAccountsContainersWorkspacesFolders($parent, $optParams = [])
107  {
108    $params = ['parent' => $parent];
109    $params = array_merge($params, $optParams);
110    return $this->call('list', [$params], ListFoldersResponse::class);
111  }
112  /**
113   * Moves entities to a GTM Folder. (folders.move_entities_to_folder)
114   *
115   * @param string $path GTM Folder's API relative path. Example: accounts/{accoun
116   * t_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}
117   * @param Folder $postBody
118   * @param array $optParams Optional parameters.
119   *
120   * @opt_param string tagId The tags to be moved to the folder.
121   * @opt_param string triggerId The triggers to be moved to the folder.
122   * @opt_param string variableId The variables to be moved to the folder.
123   */
124  public function move_entities_to_folder($path, Folder $postBody, $optParams = [])
125  {
126    $params = ['path' => $path, 'postBody' => $postBody];
127    $params = array_merge($params, $optParams);
128    return $this->call('move_entities_to_folder', [$params]);
129  }
130  /**
131   * Reverts changes to a GTM Folder in a GTM Workspace. (folders.revert)
132   *
133   * @param string $path GTM Folder's API relative path. Example: accounts/{accoun
134   * t_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}
135   * @param array $optParams Optional parameters.
136   *
137   * @opt_param string fingerprint When provided, this fingerprint must match the
138   * fingerprint of the tag in storage.
139   * @return RevertFolderResponse
140   */
141  public function revert($path, $optParams = [])
142  {
143    $params = ['path' => $path];
144    $params = array_merge($params, $optParams);
145    return $this->call('revert', [$params], RevertFolderResponse::class);
146  }
147  /**
148   * Updates a GTM Folder. (folders.update)
149   *
150   * @param string $path GTM Folder's API relative path. Example: accounts/{accoun
151   * t_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}
152   * @param Folder $postBody
153   * @param array $optParams Optional parameters.
154   *
155   * @opt_param string fingerprint When provided, this fingerprint must match the
156   * fingerprint of the folder in storage.
157   * @return Folder
158   */
159  public function update($path, Folder $postBody, $optParams = [])
160  {
161    $params = ['path' => $path, 'postBody' => $postBody];
162    $params = array_merge($params, $optParams);
163    return $this->call('update', [$params], Folder::class);
164  }
165}
166
167// Adding a class alias for backwards compatibility with the previous class name.
168class_alias(AccountsContainersWorkspacesFolders::class, 'Google_Service_TagManager_Resource_AccountsContainersWorkspacesFolders');
169