[e3d4e0a] | 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 | namespace Google\Service\Compute\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Compute\LicenseCode;
|
---|
| 21 | use Google\Service\Compute\TestPermissionsRequest;
|
---|
| 22 | use Google\Service\Compute\TestPermissionsResponse;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "licenseCodes" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $computeService = new Google\Service\Compute(...);
|
---|
| 29 | * $licenseCodes = $computeService->licenseCodes;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class LicenseCodes extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Return a specified license code. License codes are mirrored across all
|
---|
| 36 | * projects that have permissions to read the License Code. *Caution* This
|
---|
| 37 | * resource is intended for use only by third-party partners who are creating
|
---|
| 38 | * Cloud Marketplace images. (licenseCodes.get)
|
---|
| 39 | *
|
---|
| 40 | * @param string $project Project ID for this request.
|
---|
| 41 | * @param string $licenseCode Number corresponding to the License code resource
|
---|
| 42 | * to return.
|
---|
| 43 | * @param array $optParams Optional parameters.
|
---|
| 44 | * @return LicenseCode
|
---|
| 45 | * @throws \Google\Service\Exception
|
---|
| 46 | */
|
---|
| 47 | public function get($project, $licenseCode, $optParams = [])
|
---|
| 48 | {
|
---|
| 49 | $params = ['project' => $project, 'licenseCode' => $licenseCode];
|
---|
| 50 | $params = array_merge($params, $optParams);
|
---|
| 51 | return $this->call('get', [$params], LicenseCode::class);
|
---|
| 52 | }
|
---|
| 53 | /**
|
---|
| 54 | * Returns permissions that a caller has on the specified resource. *Caution*
|
---|
| 55 | * This resource is intended for use only by third-party partners who are
|
---|
| 56 | * creating Cloud Marketplace images. (licenseCodes.testIamPermissions)
|
---|
| 57 | *
|
---|
| 58 | * @param string $project Project ID for this request.
|
---|
| 59 | * @param string $resource Name or id of the resource for this request.
|
---|
| 60 | * @param TestPermissionsRequest $postBody
|
---|
| 61 | * @param array $optParams Optional parameters.
|
---|
| 62 | * @return TestPermissionsResponse
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
| 70 | }
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 74 | class_alias(LicenseCodes::class, 'Google_Service_Compute_Resource_LicenseCodes');
|
---|