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 18/** 19 * The "licenses" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $computeService = new Google_Service_Compute(...); 23 * $licenses = $computeService->licenses; 24 * </code> 25 */ 26class Google_Service_Compute_Resource_Licenses extends Google_Service_Resource 27{ 28 /** 29 * Deletes the specified license. Caution This resource is intended for use 30 * only by third-party partners who are creating Cloud Marketplace images. 31 * (licenses.delete) 32 * 33 * @param string $project Project ID for this request. 34 * @param string $license Name of the license resource to delete. 35 * @param array $optParams Optional parameters. 36 * 37 * @opt_param string requestId An optional request ID to identify requests. 38 * Specify a unique request ID so that if you must retry your request, the 39 * server will know to ignore the request if it has already been completed. 40 * 41 * For example, consider a situation where you make an initial request and the 42 * request times out. If you make the request again with the same request ID, 43 * the server can check if original operation with the same request ID was 44 * received, and if so, will ignore the second request. This prevents clients 45 * from accidentally creating duplicate commitments. 46 * 47 * The request ID must be a valid UUID with the exception that zero UUID is not 48 * supported (00000000-0000-0000-0000-000000000000). 49 * @return Google_Service_Compute_Operation 50 */ 51 public function delete($project, $license, $optParams = array()) 52 { 53 $params = array('project' => $project, 'license' => $license); 54 $params = array_merge($params, $optParams); 55 return $this->call('delete', array($params), "Google_Service_Compute_Operation"); 56 } 57 /** 58 * Returns the specified License resource. Caution This resource is intended 59 * for use only by third-party partners who are creating Cloud Marketplace 60 * images. (licenses.get) 61 * 62 * @param string $project Project ID for this request. 63 * @param string $license Name of the License resource to return. 64 * @param array $optParams Optional parameters. 65 * @return Google_Service_Compute_License 66 */ 67 public function get($project, $license, $optParams = array()) 68 { 69 $params = array('project' => $project, 'license' => $license); 70 $params = array_merge($params, $optParams); 71 return $this->call('get', array($params), "Google_Service_Compute_License"); 72 } 73 /** 74 * Gets the access control policy for a resource. May be empty if no such policy 75 * or resource exists. Caution This resource is intended for use only by third- 76 * party partners who are creating Cloud Marketplace images. 77 * (licenses.getIamPolicy) 78 * 79 * @param string $project Project ID for this request. 80 * @param string $resource Name or id of the resource for this request. 81 * @param array $optParams Optional parameters. 82 * 83 * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version. 84 * @return Google_Service_Compute_Policy 85 */ 86 public function getIamPolicy($project, $resource, $optParams = array()) 87 { 88 $params = array('project' => $project, 'resource' => $resource); 89 $params = array_merge($params, $optParams); 90 return $this->call('getIamPolicy', array($params), "Google_Service_Compute_Policy"); 91 } 92 /** 93 * Create a License resource in the specified project. Caution This resource is 94 * intended for use only by third-party partners who are creating Cloud 95 * Marketplace images. (licenses.insert) 96 * 97 * @param string $project Project ID for this request. 98 * @param Google_Service_Compute_License $postBody 99 * @param array $optParams Optional parameters. 100 * 101 * @opt_param string requestId An optional request ID to identify requests. 102 * Specify a unique request ID so that if you must retry your request, the 103 * server will know to ignore the request if it has already been completed. 104 * 105 * For example, consider a situation where you make an initial request and the 106 * request times out. If you make the request again with the same request ID, 107 * the server can check if original operation with the same request ID was 108 * received, and if so, will ignore the second request. This prevents clients 109 * from accidentally creating duplicate commitments. 110 * 111 * The request ID must be a valid UUID with the exception that zero UUID is not 112 * supported (00000000-0000-0000-0000-000000000000). 113 * @return Google_Service_Compute_Operation 114 */ 115 public function insert($project, Google_Service_Compute_License $postBody, $optParams = array()) 116 { 117 $params = array('project' => $project, 'postBody' => $postBody); 118 $params = array_merge($params, $optParams); 119 return $this->call('insert', array($params), "Google_Service_Compute_Operation"); 120 } 121 /** 122 * Retrieves the list of licenses available in the specified project. This 123 * method does not get any licenses that belong to other projects, including 124 * licenses attached to publicly-available images, like Debian 9. If you want to 125 * get a list of publicly-available licenses, use this method to make a request 126 * to the respective image project, such as debian-cloud or windows-cloud. 127 * Caution This resource is intended for use only by third-party partners who 128 * are creating Cloud Marketplace images. (licenses.listLicenses) 129 * 130 * @param string $project Project ID for this request. 131 * @param array $optParams Optional parameters. 132 * 133 * @opt_param string filter A filter expression that filters resources listed in 134 * the response. The expression must specify the field name, a comparison 135 * operator, and the value that you want to use for filtering. The value must be 136 * a string, a number, or a boolean. The comparison operator must be either `=`, 137 * `!=`, `>`, or `<`. 138 * 139 * For example, if you are filtering Compute Engine instances, you can exclude 140 * instances named `example-instance` by specifying `name != example-instance`. 141 * 142 * You can also filter nested fields. For example, you could specify 143 * `scheduling.automaticRestart = false` to include instances only if they are 144 * not scheduled for automatic restarts. You can use filtering on nested fields 145 * to filter based on resource labels. 146 * 147 * To filter on multiple expressions, provide each separate expression within 148 * parentheses. For example: ``` (scheduling.automaticRestart = true) 149 * (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` 150 * expression. However, you can include `AND` and `OR` expressions explicitly. 151 * For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel 152 * Broadwell") AND (scheduling.automaticRestart = true) ``` 153 * @opt_param string maxResults The maximum number of results per page that 154 * should be returned. If the number of available results is larger than 155 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to 156 * get the next page of results in subsequent list requests. Acceptable values 157 * are `0` to `500`, inclusive. (Default: `500`) 158 * @opt_param string orderBy Sorts list results by a certain order. By default, 159 * results are returned in alphanumerical order based on the resource name. 160 * 161 * You can also sort results in descending order based on the creation timestamp 162 * using `orderBy="creationTimestamp desc"`. This sorts results based on the 163 * `creationTimestamp` field in reverse chronological order (newest result 164 * first). Use this to sort resources like operations so that the newest 165 * operation is returned first. 166 * 167 * Currently, only sorting by `name` or `creationTimestamp desc` is supported. 168 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to 169 * the `nextPageToken` returned by a previous list request to get the next page 170 * of results. 171 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior 172 * which provides partial results in case of failure. The default value is 173 * false. 174 * @return Google_Service_Compute_LicensesListResponse 175 */ 176 public function listLicenses($project, $optParams = array()) 177 { 178 $params = array('project' => $project); 179 $params = array_merge($params, $optParams); 180 return $this->call('list', array($params), "Google_Service_Compute_LicensesListResponse"); 181 } 182 /** 183 * Sets the access control policy on the specified resource. Replaces any 184 * existing policy. Caution This resource is intended for use only by third- 185 * party partners who are creating Cloud Marketplace images. 186 * (licenses.setIamPolicy) 187 * 188 * @param string $project Project ID for this request. 189 * @param string $resource Name or id of the resource for this request. 190 * @param Google_Service_Compute_GlobalSetPolicyRequest $postBody 191 * @param array $optParams Optional parameters. 192 * @return Google_Service_Compute_Policy 193 */ 194 public function setIamPolicy($project, $resource, Google_Service_Compute_GlobalSetPolicyRequest $postBody, $optParams = array()) 195 { 196 $params = array('project' => $project, 'resource' => $resource, 'postBody' => $postBody); 197 $params = array_merge($params, $optParams); 198 return $this->call('setIamPolicy', array($params), "Google_Service_Compute_Policy"); 199 } 200 /** 201 * Returns permissions that a caller has on the specified resource. Caution 202 * This resource is intended for use only by third-party partners who are 203 * creating Cloud Marketplace images. (licenses.testIamPermissions) 204 * 205 * @param string $project Project ID for this request. 206 * @param string $resource Name or id of the resource for this request. 207 * @param Google_Service_Compute_TestPermissionsRequest $postBody 208 * @param array $optParams Optional parameters. 209 * @return Google_Service_Compute_TestPermissionsResponse 210 */ 211 public function testIamPermissions($project, $resource, Google_Service_Compute_TestPermissionsRequest $postBody, $optParams = array()) 212 { 213 $params = array('project' => $project, 'resource' => $resource, 'postBody' => $postBody); 214 $params = array_merge($params, $optParams); 215 return $this->call('testIamPermissions', array($params), "Google_Service_Compute_TestPermissionsResponse"); 216 } 217} 218