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\AccessApproval\Resource; 19 20use Google\Service\AccessApproval\AccessApprovalServiceAccount; 21use Google\Service\AccessApproval\AccessApprovalSettings; 22use Google\Service\AccessApproval\AccessapprovalEmpty; 23 24/** 25 * The "folders" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $accessapprovalService = new Google\Service\AccessApproval(...); 29 * $folders = $accessapprovalService->folders; 30 * </code> 31 */ 32class Folders extends \Google\Service\Resource 33{ 34 /** 35 * Deletes the settings associated with a project, folder, or organization. This 36 * will have the effect of disabling Access Approval for the project, folder, or 37 * organization, but only if all ancestors also have Access Approval disabled. 38 * If Access Approval is enabled at a higher level of the hierarchy, then Access 39 * Approval will still be enabled at this level as the settings are inherited. 40 * (folders.deleteAccessApprovalSettings) 41 * 42 * @param string $name Name of the AccessApprovalSettings to delete. 43 * @param array $optParams Optional parameters. 44 * @return AccessapprovalEmpty 45 */ 46 public function deleteAccessApprovalSettings($name, $optParams = []) 47 { 48 $params = ['name' => $name]; 49 $params = array_merge($params, $optParams); 50 return $this->call('deleteAccessApprovalSettings', [$params], AccessapprovalEmpty::class); 51 } 52 /** 53 * Gets the settings associated with a project, folder, or organization. 54 * (folders.getAccessApprovalSettings) 55 * 56 * @param string $name The name of the AccessApprovalSettings to retrieve. 57 * Format: "{projects|folders|organizations}/{id}/accessApprovalSettings" 58 * @param array $optParams Optional parameters. 59 * @return AccessApprovalSettings 60 */ 61 public function getAccessApprovalSettings($name, $optParams = []) 62 { 63 $params = ['name' => $name]; 64 $params = array_merge($params, $optParams); 65 return $this->call('getAccessApprovalSettings', [$params], AccessApprovalSettings::class); 66 } 67 /** 68 * Retrieves the service account that is used by Access Approval to access KMS 69 * keys for signing approved approval requests. (folders.getServiceAccount) 70 * 71 * @param string $name Name of the AccessApprovalServiceAccount to retrieve. 72 * @param array $optParams Optional parameters. 73 * @return AccessApprovalServiceAccount 74 */ 75 public function getServiceAccount($name, $optParams = []) 76 { 77 $params = ['name' => $name]; 78 $params = array_merge($params, $optParams); 79 return $this->call('getServiceAccount', [$params], AccessApprovalServiceAccount::class); 80 } 81 /** 82 * Updates the settings associated with a project, folder, or organization. 83 * Settings to update are determined by the value of field_mask. 84 * (folders.updateAccessApprovalSettings) 85 * 86 * @param string $name The resource name of the settings. Format is one of: * 87 * "projects/{project}/accessApprovalSettings" * 88 * "folders/{folder}/accessApprovalSettings" * 89 * "organizations/{organization}/accessApprovalSettings" 90 * @param AccessApprovalSettings $postBody 91 * @param array $optParams Optional parameters. 92 * 93 * @opt_param string updateMask The update mask applies to the settings. Only 94 * the top level fields of AccessApprovalSettings (notification_emails & 95 * enrolled_services) are supported. For each field, if it is included, the 96 * currently stored value will be entirely overwritten with the value of the 97 * field passed in this request. For the `FieldMask` definition, see 98 * https://developers.google.com/protocol- 99 * buffers/docs/reference/google.protobuf#fieldmask If this field is left unset, 100 * only the notification_emails field will be updated. 101 * @return AccessApprovalSettings 102 */ 103 public function updateAccessApprovalSettings($name, AccessApprovalSettings $postBody, $optParams = []) 104 { 105 $params = ['name' => $name, 'postBody' => $postBody]; 106 $params = array_merge($params, $optParams); 107 return $this->call('updateAccessApprovalSettings', [$params], AccessApprovalSettings::class); 108 } 109} 110 111// Adding a class alias for backwards compatibility with the previous class name. 112class_alias(Folders::class, 'Google_Service_AccessApproval_Resource_Folders'); 113