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