source: vendor/google/apiclient-services/src/Compute/Resource/Licenses.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload new project files

  • Property mode set to 100644
File size: 12.1 KB
Line 
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\Compute\Resource;
19
20use Google\Service\Compute\GlobalSetPolicyRequest;
21use Google\Service\Compute\License;
22use Google\Service\Compute\LicensesListResponse;
23use Google\Service\Compute\Operation;
24use Google\Service\Compute\Policy;
25use Google\Service\Compute\TestPermissionsRequest;
26use Google\Service\Compute\TestPermissionsResponse;
27
28/**
29 * The "licenses" collection of methods.
30 * Typical usage is:
31 * <code>
32 * $computeService = new Google\Service\Compute(...);
33 * $licenses = $computeService->licenses;
34 * </code>
35 */
36class Licenses extends \Google\Service\Resource
37{
38 /**
39 * Deletes the specified license. *Caution* This resource is intended for use
40 * only by third-party partners who are creating Cloud Marketplace images.
41 * (licenses.delete)
42 *
43 * @param string $project Project ID for this request.
44 * @param string $license Name of the license resource to delete.
45 * @param array $optParams Optional parameters.
46 *
47 * @opt_param string requestId An optional request ID to identify requests.
48 * Specify a unique request ID so that if you must retry your request, the
49 * server will know to ignore the request if it has already been completed. For
50 * example, consider a situation where you make an initial request and the
51 * request times out. If you make the request again with the same request ID,
52 * the server can check if original operation with the same request ID was
53 * received, and if so, will ignore the second request. This prevents clients
54 * from accidentally creating duplicate commitments. The request ID must be a
55 * valid UUID with the exception that zero UUID is not supported (
56 * 00000000-0000-0000-0000-000000000000).
57 * @return Operation
58 * @throws \Google\Service\Exception
59 */
60 public function delete($project, $license, $optParams = [])
61 {
62 $params = ['project' => $project, 'license' => $license];
63 $params = array_merge($params, $optParams);
64 return $this->call('delete', [$params], Operation::class);
65 }
66 /**
67 * Returns the specified License resource. *Caution* This resource is intended
68 * for use only by third-party partners who are creating Cloud Marketplace
69 * images. (licenses.get)
70 *
71 * @param string $project Project ID for this request.
72 * @param string $license Name of the License resource to return.
73 * @param array $optParams Optional parameters.
74 * @return License
75 * @throws \Google\Service\Exception
76 */
77 public function get($project, $license, $optParams = [])
78 {
79 $params = ['project' => $project, 'license' => $license];
80 $params = array_merge($params, $optParams);
81 return $this->call('get', [$params], License::class);
82 }
83 /**
84 * Gets the access control policy for a resource. May be empty if no such policy
85 * or resource exists. *Caution* This resource is intended for use only by
86 * third-party partners who are creating Cloud Marketplace images.
87 * (licenses.getIamPolicy)
88 *
89 * @param string $project Project ID for this request.
90 * @param string $resource Name or id of the resource for this request.
91 * @param array $optParams Optional parameters.
92 *
93 * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
94 * @return Policy
95 * @throws \Google\Service\Exception
96 */
97 public function getIamPolicy($project, $resource, $optParams = [])
98 {
99 $params = ['project' => $project, 'resource' => $resource];
100 $params = array_merge($params, $optParams);
101 return $this->call('getIamPolicy', [$params], Policy::class);
102 }
103 /**
104 * Create a License resource in the specified project. *Caution* This resource
105 * is intended for use only by third-party partners who are creating Cloud
106 * Marketplace images. (licenses.insert)
107 *
108 * @param string $project Project ID for this request.
109 * @param License $postBody
110 * @param array $optParams Optional parameters.
111 *
112 * @opt_param string requestId An optional request ID to identify requests.
113 * Specify a unique request ID so that if you must retry your request, the
114 * server will know to ignore the request if it has already been completed. For
115 * example, consider a situation where you make an initial request and the
116 * request times out. If you make the request again with the same request ID,
117 * the server can check if original operation with the same request ID was
118 * received, and if so, will ignore the second request. This prevents clients
119 * from accidentally creating duplicate commitments. The request ID must be a
120 * valid UUID with the exception that zero UUID is not supported (
121 * 00000000-0000-0000-0000-000000000000).
122 * @return Operation
123 * @throws \Google\Service\Exception
124 */
125 public function insert($project, License $postBody, $optParams = [])
126 {
127 $params = ['project' => $project, 'postBody' => $postBody];
128 $params = array_merge($params, $optParams);
129 return $this->call('insert', [$params], Operation::class);
130 }
131 /**
132 * Retrieves the list of licenses available in the specified project. This
133 * method does not get any licenses that belong to other projects, including
134 * licenses attached to publicly-available images, like Debian 9. If you want to
135 * get a list of publicly-available licenses, use this method to make a request
136 * to the respective image project, such as debian-cloud or windows-cloud.
137 * *Caution* This resource is intended for use only by third-party partners who
138 * are creating Cloud Marketplace images. (licenses.listLicenses)
139 *
140 * @param string $project Project ID for this request.
141 * @param array $optParams Optional parameters.
142 *
143 * @opt_param string filter A filter expression that filters resources listed in
144 * the response. Most Compute resources support two types of filter expressions:
145 * expressions that support regular expressions and expressions that follow API
146 * improvement proposal AIP-160. These two types of filter expressions cannot be
147 * mixed in one request. If you want to use AIP-160, your expression must
148 * specify the field name, an operator, and the value that you want to use for
149 * filtering. The value must be a string, a number, or a boolean. The operator
150 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
151 * are filtering Compute Engine instances, you can exclude instances named
152 * `example-instance` by specifying `name != example-instance`. The `:*`
153 * comparison can be used to test whether a key has been defined. For example,
154 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
155 * also filter nested fields. For example, you could specify
156 * `scheduling.automaticRestart = false` to include instances only if they are
157 * not scheduled for automatic restarts. You can use filtering on nested fields
158 * to filter based on resource labels. To filter on multiple expressions,
159 * provide each separate expression within parentheses. For example: ```
160 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
161 * default, each expression is an `AND` expression. However, you can include
162 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
163 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
164 * (scheduling.automaticRestart = true) ``` If you want to use a regular
165 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
166 * single un-parenthesized expression with or without quotes or against multiple
167 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
168 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
169 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
170 * interpreted as a regular expression using Google RE2 library syntax. The
171 * literal value must match the entire field. For example, to filter for
172 * instances that do not end with name "instance", you would use `name ne
173 * .*instance`. You cannot combine constraints on multiple fields using regular
174 * expressions.
175 * @opt_param string maxResults The maximum number of results per page that
176 * should be returned. If the number of available results is larger than
177 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
178 * get the next page of results in subsequent list requests. Acceptable values
179 * are `0` to `500`, inclusive. (Default: `500`)
180 * @opt_param string orderBy Sorts list results by a certain order. By default,
181 * results are returned in alphanumerical order based on the resource name. You
182 * can also sort results in descending order based on the creation timestamp
183 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
184 * `creationTimestamp` field in reverse chronological order (newest result
185 * first). Use this to sort resources like operations so that the newest
186 * operation is returned first. Currently, only sorting by `name` or
187 * `creationTimestamp desc` is supported.
188 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
189 * the `nextPageToken` returned by a previous list request to get the next page
190 * of results.
191 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
192 * which provides partial results in case of failure. The default value is
193 * false. For example, when partial success behavior is enabled, aggregatedList
194 * for a single zone scope either returns all resources in the zone or no
195 * resources, with an error code.
196 * @return LicensesListResponse
197 * @throws \Google\Service\Exception
198 */
199 public function listLicenses($project, $optParams = [])
200 {
201 $params = ['project' => $project];
202 $params = array_merge($params, $optParams);
203 return $this->call('list', [$params], LicensesListResponse::class);
204 }
205 /**
206 * Sets the access control policy on the specified resource. Replaces any
207 * existing policy. *Caution* This resource is intended for use only by third-
208 * party partners who are creating Cloud Marketplace images.
209 * (licenses.setIamPolicy)
210 *
211 * @param string $project Project ID for this request.
212 * @param string $resource Name or id of the resource for this request.
213 * @param GlobalSetPolicyRequest $postBody
214 * @param array $optParams Optional parameters.
215 * @return Policy
216 * @throws \Google\Service\Exception
217 */
218 public function setIamPolicy($project, $resource, GlobalSetPolicyRequest $postBody, $optParams = [])
219 {
220 $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
221 $params = array_merge($params, $optParams);
222 return $this->call('setIamPolicy', [$params], Policy::class);
223 }
224 /**
225 * Returns permissions that a caller has on the specified resource. *Caution*
226 * This resource is intended for use only by third-party partners who are
227 * creating Cloud Marketplace images. (licenses.testIamPermissions)
228 *
229 * @param string $project Project ID for this request.
230 * @param string $resource Name or id of the resource for this request.
231 * @param TestPermissionsRequest $postBody
232 * @param array $optParams Optional parameters.
233 * @return TestPermissionsResponse
234 * @throws \Google\Service\Exception
235 */
236 public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
237 {
238 $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
239 $params = array_merge($params, $optParams);
240 return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
241 }
242}
243
244// Adding a class alias for backwards compatibility with the previous class name.
245class_alias(Licenses::class, 'Google_Service_Compute_Resource_Licenses');
Note: See TracBrowser for help on using the repository browser.