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\Environment;
21use Google\Service\TagManager\ListEnvironmentsResponse;
22
23/**
24 * The "environments" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $tagmanagerService = new Google\Service\TagManager(...);
28 *   $environments = $tagmanagerService->environments;
29 *  </code>
30 */
31class AccountsContainersEnvironments extends \Google\Service\Resource
32{
33  /**
34   * Creates a GTM Environment. (environments.create)
35   *
36   * @param string $parent GTM Container's API relative path. Example:
37   * accounts/{account_id}/containers/{container_id}
38   * @param Environment $postBody
39   * @param array $optParams Optional parameters.
40   * @return Environment
41   */
42  public function create($parent, Environment $postBody, $optParams = [])
43  {
44    $params = ['parent' => $parent, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], Environment::class);
47  }
48  /**
49   * Deletes a GTM Environment. (environments.delete)
50   *
51   * @param string $path GTM Environment's API relative path. Example:
52   * accounts/{account_id}/containers/{container_id}/environments/{environment_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 GTM Environment. (environments.get)
63   *
64   * @param string $path GTM Environment's API relative path. Example:
65   * accounts/{account_id}/containers/{container_id}/environments/{environment_id}
66   * @param array $optParams Optional parameters.
67   * @return Environment
68   */
69  public function get($path, $optParams = [])
70  {
71    $params = ['path' => $path];
72    $params = array_merge($params, $optParams);
73    return $this->call('get', [$params], Environment::class);
74  }
75  /**
76   * Lists all GTM Environments of a GTM Container.
77   * (environments.listAccountsContainersEnvironments)
78   *
79   * @param string $parent GTM Container's API relative path. Example:
80   * accounts/{account_id}/containers/{container_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 ListEnvironmentsResponse
86   */
87  public function listAccountsContainersEnvironments($parent, $optParams = [])
88  {
89    $params = ['parent' => $parent];
90    $params = array_merge($params, $optParams);
91    return $this->call('list', [$params], ListEnvironmentsResponse::class);
92  }
93  /**
94   * Re-generates the authorization code for a GTM Environment.
95   * (environments.reauthorize)
96   *
97   * @param string $path GTM Environment's API relative path. Example:
98   * accounts/{account_id}/containers/{container_id}/environments/{environment_id}
99   * @param Environment $postBody
100   * @param array $optParams Optional parameters.
101   * @return Environment
102   */
103  public function reauthorize($path, Environment $postBody, $optParams = [])
104  {
105    $params = ['path' => $path, 'postBody' => $postBody];
106    $params = array_merge($params, $optParams);
107    return $this->call('reauthorize', [$params], Environment::class);
108  }
109  /**
110   * Updates a GTM Environment. (environments.update)
111   *
112   * @param string $path GTM Environment's API relative path. Example:
113   * accounts/{account_id}/containers/{container_id}/environments/{environment_id}
114   * @param Environment $postBody
115   * @param array $optParams Optional parameters.
116   *
117   * @opt_param string fingerprint When provided, this fingerprint must match the
118   * fingerprint of the environment in storage.
119   * @return Environment
120   */
121  public function update($path, Environment $postBody, $optParams = [])
122  {
123    $params = ['path' => $path, 'postBody' => $postBody];
124    $params = array_merge($params, $optParams);
125    return $this->call('update', [$params], Environment::class);
126  }
127}
128
129// Adding a class alias for backwards compatibility with the previous class name.
130class_alias(AccountsContainersEnvironments::class, 'Google_Service_TagManager_Resource_AccountsContainersEnvironments');
131