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\ListVariablesResponse;
21use Google\Service\TagManager\RevertVariableResponse;
22use Google\Service\TagManager\Variable;
23
24/**
25 * The "variables" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $tagmanagerService = new Google\Service\TagManager(...);
29 *   $variables = $tagmanagerService->variables;
30 *  </code>
31 */
32class AccountsContainersWorkspacesVariables extends \Google\Service\Resource
33{
34  /**
35   * Creates a GTM Variable. (variables.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 Variable $postBody
40   * @param array $optParams Optional parameters.
41   * @return Variable
42   */
43  public function create($parent, Variable $postBody, $optParams = [])
44  {
45    $params = ['parent' => $parent, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], Variable::class);
48  }
49  /**
50   * Deletes a GTM Variable. (variables.delete)
51   *
52   * @param string $path GTM Variable's API relative path. Example: accounts/{acco
53   * unt_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variab
54   * le_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 Variable. (variables.get)
65   *
66   * @param string $path GTM Variable's API relative path. Example: accounts/{acco
67   * unt_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variab
68   * le_id}
69   * @param array $optParams Optional parameters.
70   * @return Variable
71   */
72  public function get($path, $optParams = [])
73  {
74    $params = ['path' => $path];
75    $params = array_merge($params, $optParams);
76    return $this->call('get', [$params], Variable::class);
77  }
78  /**
79   * Lists all GTM Variables of a Container.
80   * (variables.listAccountsContainersWorkspacesVariables)
81   *
82   * @param string $parent GTM Workspace'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 ListVariablesResponse
89   */
90  public function listAccountsContainersWorkspacesVariables($parent, $optParams = [])
91  {
92    $params = ['parent' => $parent];
93    $params = array_merge($params, $optParams);
94    return $this->call('list', [$params], ListVariablesResponse::class);
95  }
96  /**
97   * Reverts changes to a GTM Variable in a GTM Workspace. (variables.revert)
98   *
99   * @param string $path GTM Variable's API relative path. Example: accounts/{acco
100   * unt_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variab
101   * le_id}
102   * @param array $optParams Optional parameters.
103   *
104   * @opt_param string fingerprint When provided, this fingerprint must match the
105   * fingerprint of the variable in storage.
106   * @return RevertVariableResponse
107   */
108  public function revert($path, $optParams = [])
109  {
110    $params = ['path' => $path];
111    $params = array_merge($params, $optParams);
112    return $this->call('revert', [$params], RevertVariableResponse::class);
113  }
114  /**
115   * Updates a GTM Variable. (variables.update)
116   *
117   * @param string $path GTM Variable's API relative path. Example: accounts/{acco
118   * unt_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variab
119   * le_id}
120   * @param Variable $postBody
121   * @param array $optParams Optional parameters.
122   *
123   * @opt_param string fingerprint When provided, this fingerprint must match the
124   * fingerprint of the variable in storage.
125   * @return Variable
126   */
127  public function update($path, Variable $postBody, $optParams = [])
128  {
129    $params = ['path' => $path, 'postBody' => $postBody];
130    $params = array_merge($params, $optParams);
131    return $this->call('update', [$params], Variable::class);
132  }
133}
134
135// Adding a class alias for backwards compatibility with the previous class name.
136class_alias(AccountsContainersWorkspacesVariables::class, 'Google_Service_TagManager_Resource_AccountsContainersWorkspacesVariables');
137