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