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\ToolResults\Resource;
19
20use Google\Service\ToolResults\Environment;
21use Google\Service\ToolResults\ListEnvironmentsResponse;
22
23/**
24 * The "environments" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $toolresultsService = new Google\Service\ToolResults(...);
28 *   $environments = $toolresultsService->environments;
29 *  </code>
30 */
31class ProjectsHistoriesExecutionsEnvironments extends \Google\Service\Resource
32{
33  /**
34   * Gets an Environment. May return any of the following canonical error codes: -
35   * PERMISSION_DENIED - if the user is not authorized to read project -
36   * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the
37   * Environment does not exist (environments.get)
38   *
39   * @param string $projectId Required. A Project id.
40   * @param string $historyId Required. A History id.
41   * @param string $executionId Required. An Execution id.
42   * @param string $environmentId Required. An Environment id.
43   * @param array $optParams Optional parameters.
44   * @return Environment
45   */
46  public function get($projectId, $historyId, $executionId, $environmentId, $optParams = [])
47  {
48    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'environmentId' => $environmentId];
49    $params = array_merge($params, $optParams);
50    return $this->call('get', [$params], Environment::class);
51  }
52  /**
53   * Lists Environments for a given Execution. The Environments are sorted by
54   * display name. May return any of the following canonical error codes: -
55   * PERMISSION_DENIED - if the user is not authorized to read project -
56   * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the
57   * containing Execution does not exist
58   * (environments.listProjectsHistoriesExecutionsEnvironments)
59   *
60   * @param string $projectId Required. A Project id.
61   * @param string $historyId Required. A History id.
62   * @param string $executionId Required. An Execution id.
63   * @param array $optParams Optional parameters.
64   *
65   * @opt_param int pageSize The maximum number of Environments to fetch. Default
66   * value: 25. The server will use this default if the field is not set or has a
67   * value of 0.
68   * @opt_param string pageToken A continuation token to resume the query at the
69   * next item.
70   * @return ListEnvironmentsResponse
71   */
72  public function listProjectsHistoriesExecutionsEnvironments($projectId, $historyId, $executionId, $optParams = [])
73  {
74    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId];
75    $params = array_merge($params, $optParams);
76    return $this->call('list', [$params], ListEnvironmentsResponse::class);
77  }
78}
79
80// Adding a class alias for backwards compatibility with the previous class name.
81class_alias(ProjectsHistoriesExecutionsEnvironments::class, 'Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsEnvironments');
82