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 "organizations" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $accessapprovalService = new Google\Service\AccessApproval(...);
29 *   $organizations = $accessapprovalService->organizations;
30 *  </code>
31 */
32class Organizations 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   * (organizations.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   * (organizations.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.
70   * (organizations.getServiceAccount)
71   *
72   * @param string $name Name of the AccessApprovalServiceAccount to retrieve.
73   * @param array $optParams Optional parameters.
74   * @return AccessApprovalServiceAccount
75   */
76  public function getServiceAccount($name, $optParams = [])
77  {
78    $params = ['name' => $name];
79    $params = array_merge($params, $optParams);
80    return $this->call('getServiceAccount', [$params], AccessApprovalServiceAccount::class);
81  }
82  /**
83   * Updates the settings associated with a project, folder, or organization.
84   * Settings to update are determined by the value of field_mask.
85   * (organizations.updateAccessApprovalSettings)
86   *
87   * @param string $name The resource name of the settings. Format is one of: *
88   * "projects/{project}/accessApprovalSettings" *
89   * "folders/{folder}/accessApprovalSettings" *
90   * "organizations/{organization}/accessApprovalSettings"
91   * @param AccessApprovalSettings $postBody
92   * @param array $optParams Optional parameters.
93   *
94   * @opt_param string updateMask The update mask applies to the settings. Only
95   * the top level fields of AccessApprovalSettings (notification_emails &
96   * enrolled_services) are supported. For each field, if it is included, the
97   * currently stored value will be entirely overwritten with the value of the
98   * field passed in this request. For the `FieldMask` definition, see
99   * https://developers.google.com/protocol-
100   * buffers/docs/reference/google.protobuf#fieldmask If this field is left unset,
101   * only the notification_emails field will be updated.
102   * @return AccessApprovalSettings
103   */
104  public function updateAccessApprovalSettings($name, AccessApprovalSettings $postBody, $optParams = [])
105  {
106    $params = ['name' => $name, 'postBody' => $postBody];
107    $params = array_merge($params, $optParams);
108    return $this->call('updateAccessApprovalSettings', [$params], AccessApprovalSettings::class);
109  }
110}
111
112// Adding a class alias for backwards compatibility with the previous class name.
113class_alias(Organizations::class, 'Google_Service_AccessApproval_Resource_Organizations');
114