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\ContainerVersion; 21use Google\Service\TagManager\PublishContainerVersionResponse; 22 23/** 24 * The "versions" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $tagmanagerService = new Google\Service\TagManager(...); 28 * $versions = $tagmanagerService->versions; 29 * </code> 30 */ 31class AccountsContainersVersions extends \Google\Service\Resource 32{ 33 /** 34 * Deletes a Container Version. (versions.delete) 35 * 36 * @param string $path GTM ContainerVersion's API relative path. Example: 37 * accounts/{account_id}/containers/{container_id}/versions/{version_id} 38 * @param array $optParams Optional parameters. 39 */ 40 public function delete($path, $optParams = []) 41 { 42 $params = ['path' => $path]; 43 $params = array_merge($params, $optParams); 44 return $this->call('delete', [$params]); 45 } 46 /** 47 * Gets a Container Version. (versions.get) 48 * 49 * @param string $path GTM ContainerVersion's API relative path. Example: 50 * accounts/{account_id}/containers/{container_id}/versions/{version_id} 51 * @param array $optParams Optional parameters. 52 * 53 * @opt_param string containerVersionId The GTM ContainerVersion ID. Specify 54 * published to retrieve the currently published version. 55 * @return ContainerVersion 56 */ 57 public function get($path, $optParams = []) 58 { 59 $params = ['path' => $path]; 60 $params = array_merge($params, $optParams); 61 return $this->call('get', [$params], ContainerVersion::class); 62 } 63 /** 64 * Gets the live (i.e. published) container version (versions.live) 65 * 66 * @param string $parent GTM Container's API relative path. Example: 67 * accounts/{account_id}/containers/{container_id} 68 * @param array $optParams Optional parameters. 69 * @return ContainerVersion 70 */ 71 public function live($parent, $optParams = []) 72 { 73 $params = ['parent' => $parent]; 74 $params = array_merge($params, $optParams); 75 return $this->call('live', [$params], ContainerVersion::class); 76 } 77 /** 78 * Publishes a Container Version. (versions.publish) 79 * 80 * @param string $path GTM ContainerVersion's API relative path. Example: 81 * accounts/{account_id}/containers/{container_id}/versions/{version_id} 82 * @param array $optParams Optional parameters. 83 * 84 * @opt_param string fingerprint When provided, this fingerprint must match the 85 * fingerprint of the container version in storage. 86 * @return PublishContainerVersionResponse 87 */ 88 public function publish($path, $optParams = []) 89 { 90 $params = ['path' => $path]; 91 $params = array_merge($params, $optParams); 92 return $this->call('publish', [$params], PublishContainerVersionResponse::class); 93 } 94 /** 95 * Sets the latest version used for synchronization of workspaces when detecting 96 * conflicts and errors. (versions.set_latest) 97 * 98 * @param string $path GTM ContainerVersion's API relative path. Example: 99 * accounts/{account_id}/containers/{container_id}/versions/{version_id} 100 * @param array $optParams Optional parameters. 101 * @return ContainerVersion 102 */ 103 public function set_latest($path, $optParams = []) 104 { 105 $params = ['path' => $path]; 106 $params = array_merge($params, $optParams); 107 return $this->call('set_latest', [$params], ContainerVersion::class); 108 } 109 /** 110 * Undeletes a Container Version. (versions.undelete) 111 * 112 * @param string $path GTM ContainerVersion's API relative path. Example: 113 * accounts/{account_id}/containers/{container_id}/versions/{version_id} 114 * @param array $optParams Optional parameters. 115 * @return ContainerVersion 116 */ 117 public function undelete($path, $optParams = []) 118 { 119 $params = ['path' => $path]; 120 $params = array_merge($params, $optParams); 121 return $this->call('undelete', [$params], ContainerVersion::class); 122 } 123 /** 124 * Updates a Container Version. (versions.update) 125 * 126 * @param string $path GTM ContainerVersion's API relative path. Example: 127 * accounts/{account_id}/containers/{container_id}/versions/{version_id} 128 * @param ContainerVersion $postBody 129 * @param array $optParams Optional parameters. 130 * 131 * @opt_param string fingerprint When provided, this fingerprint must match the 132 * fingerprint of the container version in storage. 133 * @return ContainerVersion 134 */ 135 public function update($path, ContainerVersion $postBody, $optParams = []) 136 { 137 $params = ['path' => $path, 'postBody' => $postBody]; 138 $params = array_merge($params, $optParams); 139 return $this->call('update', [$params], ContainerVersion::class); 140 } 141} 142 143// Adding a class alias for backwards compatibility with the previous class name. 144class_alias(AccountsContainersVersions::class, 'Google_Service_TagManager_Resource_AccountsContainersVersions'); 145