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\RemoteBuildExecution\Resource;
19
20use Google\Service\RemoteBuildExecution\BuildBazelRemoteExecutionV2ServerCapabilities;
21
22/**
23 * The "v2" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $remotebuildexecutionService = new Google\Service\RemoteBuildExecution(...);
27 *   $v2 = $remotebuildexecutionService->v2;
28 *  </code>
29 */
30class V2 extends \Google\Service\Resource
31{
32  /**
33   * GetCapabilities returns the server capabilities configuration of the remote
34   * endpoint. Only the capabilities of the services supported by the endpoint
35   * will be returned: * Execution + CAS + Action Cache endpoints should return
36   * both CacheCapabilities and ExecutionCapabilities. * Execution only endpoints
37   * should return ExecutionCapabilities. * CAS + Action Cache only endpoints
38   * should return CacheCapabilities. (v2.getCapabilities)
39   *
40   * @param string $instanceName The instance of the execution system to operate
41   * against. A server may support multiple instances of the execution system
42   * (with their own workers, storage, caches, etc.). The server MAY require use
43   * of this field to select between them in an implementation-defined fashion,
44   * otherwise it can be omitted.
45   * @param array $optParams Optional parameters.
46   * @return BuildBazelRemoteExecutionV2ServerCapabilities
47   */
48  public function getCapabilities($instanceName, $optParams = [])
49  {
50    $params = ['instanceName' => $instanceName];
51    $params = array_merge($params, $optParams);
52    return $this->call('getCapabilities', [$params], BuildBazelRemoteExecutionV2ServerCapabilities::class);
53  }
54}
55
56// Adding a class alias for backwards compatibility with the previous class name.
57class_alias(V2::class, 'Google_Service_RemoteBuildExecution_Resource_V2');
58