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\LicenseCode;
21use Google\Service\Compute\TestPermissionsRequest;
22use 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 */
32class 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   */
46  public function get($project, $licenseCode, $optParams = [])
47  {
48    $params = ['project' => $project, 'licenseCode' => $licenseCode];
49    $params = array_merge($params, $optParams);
50    return $this->call('get', [$params], LicenseCode::class);
51  }
52  /**
53   * Returns permissions that a caller has on the specified resource. *Caution*
54   * This resource is intended for use only by third-party partners who are
55   * creating Cloud Marketplace images.  (licenseCodes.testIamPermissions)
56   *
57   * @param string $project Project ID for this request.
58   * @param string $resource Name or id of the resource for this request.
59   * @param TestPermissionsRequest $postBody
60   * @param array $optParams Optional parameters.
61   * @return TestPermissionsResponse
62   */
63  public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
64  {
65    $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
66    $params = array_merge($params, $optParams);
67    return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
68  }
69}
70
71// Adding a class alias for backwards compatibility with the previous class name.
72class_alias(LicenseCodes::class, 'Google_Service_Compute_Resource_LicenseCodes');
73