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
18/**
19 * The "workspaces" collection of methods.
20 * Typical usage is:
21 *  <code>
22 *   $tagmanagerService = new Google_Service_TagManager(...);
23 *   $workspaces = $tagmanagerService->workspaces;
24 *  </code>
25 */
26class Google_Service_TagManager_Resource_AccountsContainersWorkspaces extends Google_Service_Resource
27{
28  /**
29   * Creates a Workspace. (workspaces.create)
30   *
31   * @param string $parent GTM parent Container's API relative path. Example:
32   * accounts/{account_id}/containers/{container_id}
33   * @param Google_Service_TagManager_Workspace $postBody
34   * @param array $optParams Optional parameters.
35   * @return Google_Service_TagManager_Workspace
36   */
37  public function create($parent, Google_Service_TagManager_Workspace $postBody, $optParams = array())
38  {
39    $params = array('parent' => $parent, 'postBody' => $postBody);
40    $params = array_merge($params, $optParams);
41    return $this->call('create', array($params), "Google_Service_TagManager_Workspace");
42  }
43  /**
44   * Creates a Container Version from the entities present in the workspace,
45   * deletes the workspace, and sets the base container version to the newly
46   * created version. (workspaces.create_version)
47   *
48   * @param string $path GTM Workspace's API relative path. Example:
49   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
50   * @param Google_Service_TagManager_CreateContainerVersionRequestVersionOptions $postBody
51   * @param array $optParams Optional parameters.
52   * @return Google_Service_TagManager_CreateContainerVersionResponse
53   */
54  public function create_version($path, Google_Service_TagManager_CreateContainerVersionRequestVersionOptions $postBody, $optParams = array())
55  {
56    $params = array('path' => $path, 'postBody' => $postBody);
57    $params = array_merge($params, $optParams);
58    return $this->call('create_version', array($params), "Google_Service_TagManager_CreateContainerVersionResponse");
59  }
60  /**
61   * Deletes a Workspace. (workspaces.delete)
62   *
63   * @param string $path GTM Workspace's API relative path. Example:
64   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
65   * @param array $optParams Optional parameters.
66   */
67  public function delete($path, $optParams = array())
68  {
69    $params = array('path' => $path);
70    $params = array_merge($params, $optParams);
71    return $this->call('delete', array($params));
72  }
73  /**
74   * Gets a Workspace. (workspaces.get)
75   *
76   * @param string $path GTM Workspace's API relative path. Example:
77   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
78   * @param array $optParams Optional parameters.
79   * @return Google_Service_TagManager_Workspace
80   */
81  public function get($path, $optParams = array())
82  {
83    $params = array('path' => $path);
84    $params = array_merge($params, $optParams);
85    return $this->call('get', array($params), "Google_Service_TagManager_Workspace");
86  }
87  /**
88   * Finds conflicting and modified entities in the workspace.
89   * (workspaces.getStatus)
90   *
91   * @param string $path GTM Workspace's API relative path. Example:
92   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
93   * @param array $optParams Optional parameters.
94   * @return Google_Service_TagManager_GetWorkspaceStatusResponse
95   */
96  public function getStatus($path, $optParams = array())
97  {
98    $params = array('path' => $path);
99    $params = array_merge($params, $optParams);
100    return $this->call('getStatus', array($params), "Google_Service_TagManager_GetWorkspaceStatusResponse");
101  }
102  /**
103   * Lists all Workspaces that belong to a GTM Container.
104   * (workspaces.listAccountsContainersWorkspaces)
105   *
106   * @param string $parent GTM parent Container's API relative path. Example:
107   * accounts/{account_id}/containers/{container_id}
108   * @param array $optParams Optional parameters.
109   *
110   * @opt_param string pageToken Continuation token for fetching the next page of
111   * results.
112   * @return Google_Service_TagManager_ListWorkspacesResponse
113   */
114  public function listAccountsContainersWorkspaces($parent, $optParams = array())
115  {
116    $params = array('parent' => $parent);
117    $params = array_merge($params, $optParams);
118    return $this->call('list', array($params), "Google_Service_TagManager_ListWorkspacesResponse");
119  }
120  /**
121   * Quick previews a workspace by creating a fake container version from all
122   * entities in the provided workspace. (workspaces.quick_preview)
123   *
124   * @param string $path GTM Workspace's API relative path. Example:
125   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
126   * @param array $optParams Optional parameters.
127   * @return Google_Service_TagManager_QuickPreviewResponse
128   */
129  public function quick_preview($path, $optParams = array())
130  {
131    $params = array('path' => $path);
132    $params = array_merge($params, $optParams);
133    return $this->call('quick_preview', array($params), "Google_Service_TagManager_QuickPreviewResponse");
134  }
135  /**
136   * Resolves a merge conflict for a workspace entity by updating it to the
137   * resolved entity passed in the request. (workspaces.resolve_conflict)
138   *
139   * @param string $path GTM Workspace's API relative path. Example:
140   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
141   * @param Google_Service_TagManager_Entity $postBody
142   * @param array $optParams Optional parameters.
143   *
144   * @opt_param string fingerprint When provided, this fingerprint must match the
145   * fingerprint of the entity_in_workspace in the merge conflict.
146   */
147  public function resolve_conflict($path, Google_Service_TagManager_Entity $postBody, $optParams = array())
148  {
149    $params = array('path' => $path, 'postBody' => $postBody);
150    $params = array_merge($params, $optParams);
151    return $this->call('resolve_conflict', array($params));
152  }
153  /**
154   * Syncs a workspace to the latest container version by updating all unmodified
155   * workspace entities and displaying conflicts for modified entities.
156   * (workspaces.sync)
157   *
158   * @param string $path GTM Workspace's API relative path. Example:
159   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
160   * @param array $optParams Optional parameters.
161   * @return Google_Service_TagManager_SyncWorkspaceResponse
162   */
163  public function sync($path, $optParams = array())
164  {
165    $params = array('path' => $path);
166    $params = array_merge($params, $optParams);
167    return $this->call('sync', array($params), "Google_Service_TagManager_SyncWorkspaceResponse");
168  }
169  /**
170   * Updates a Workspace. (workspaces.update)
171   *
172   * @param string $path GTM Workspace's API relative path. Example:
173   * accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}
174   * @param Google_Service_TagManager_Workspace $postBody
175   * @param array $optParams Optional parameters.
176   *
177   * @opt_param string fingerprint When provided, this fingerprint must match the
178   * fingerprint of the workspace in storage.
179   * @return Google_Service_TagManager_Workspace
180   */
181  public function update($path, Google_Service_TagManager_Workspace $postBody, $optParams = array())
182  {
183    $params = array('path' => $path, 'postBody' => $postBody);
184    $params = array_merge($params, $optParams);
185    return $this->call('update', array($params), "Google_Service_TagManager_Workspace");
186  }
187}
188