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\ProjectSettings;
21
22/**
23 * The "projects" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $toolresultsService = new Google\Service\ToolResults(...);
27 *   $projects = $toolresultsService->projects;
28 *  </code>
29 */
30class Projects extends \Google\Service\Resource
31{
32  /**
33   * Gets the Tool Results settings for a project. May return any of the following
34   * canonical error codes: - PERMISSION_DENIED - if the user is not authorized to
35   * read from project (projects.getSettings)
36   *
37   * @param string $projectId A Project id. Required.
38   * @param array $optParams Optional parameters.
39   * @return ProjectSettings
40   */
41  public function getSettings($projectId, $optParams = [])
42  {
43    $params = ['projectId' => $projectId];
44    $params = array_merge($params, $optParams);
45    return $this->call('getSettings', [$params], ProjectSettings::class);
46  }
47  /**
48   * Creates resources for settings which have not yet been set. Currently, this
49   * creates a single resource: a Google Cloud Storage bucket, to be used as the
50   * default bucket for this project. The bucket is created in an FTL-own storage
51   * project. Except for in rare cases, calling this method in parallel from
52   * multiple clients will only create a single bucket. In order to avoid
53   * unnecessary storage charges, the bucket is configured to automatically delete
54   * objects older than 90 days. The bucket is created with the following
55   * permissions: - Owner access for owners of central storage project (FTL-owned)
56   * - Writer access for owners/editors of customer project - Reader access for
57   * viewers of customer project The default ACL on objects created in the bucket
58   * is: - Owner access for owners of central storage project - Reader access for
59   * owners/editors/viewers of customer project See Google Cloud Storage
60   * documentation for more details. If there is already a default bucket set and
61   * the project can access the bucket, this call does nothing. However, if the
62   * project doesn't have the permission to access the bucket or the bucket is
63   * deleted, a new bucket will be created. May return any canonical error codes,
64   * including the following: - PERMISSION_DENIED - if the user is not authorized
65   * to write to project - Any error code raised by Google Cloud Storage
66   * (projects.initializeSettings)
67   *
68   * @param string $projectId A Project id. Required.
69   * @param array $optParams Optional parameters.
70   * @return ProjectSettings
71   */
72  public function initializeSettings($projectId, $optParams = [])
73  {
74    $params = ['projectId' => $projectId];
75    $params = array_merge($params, $optParams);
76    return $this->call('initializeSettings', [$params], ProjectSettings::class);
77  }
78}
79
80// Adding a class alias for backwards compatibility with the previous class name.
81class_alias(Projects::class, 'Google_Service_ToolResults_Resource_Projects');
82