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