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\ResourceSettings\Resource;
19
20use Google\Service\ResourceSettings\GoogleCloudResourcesettingsV1ListSettingsResponse;
21use Google\Service\ResourceSettings\GoogleCloudResourcesettingsV1Setting;
22
23/**
24 * The "settings" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $resourcesettingsService = new Google\Service\ResourceSettings(...);
28 *   $settings = $resourcesettingsService->settings;
29 *  </code>
30 */
31class OrganizationsSettings extends \Google\Service\Resource
32{
33  /**
34   * Returns a specified setting. Returns a `google.rpc.Status` with
35   * `google.rpc.Code.NOT_FOUND` if the setting does not exist. (settings.get)
36   *
37   * @param string $name Required. The name of the setting to get. See Setting for
38   * naming requirements.
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string view The SettingView for this request.
42   * @return GoogleCloudResourcesettingsV1Setting
43   */
44  public function get($name, $optParams = [])
45  {
46    $params = ['name' => $name];
47    $params = array_merge($params, $optParams);
48    return $this->call('get', [$params], GoogleCloudResourcesettingsV1Setting::class);
49  }
50  /**
51   * Lists all the settings that are available on the Cloud resource `parent`.
52   * (settings.listOrganizationsSettings)
53   *
54   * @param string $parent Required. The project, folder, or organization that is
55   * the parent resource for this setting. Must be in one of the following forms:
56   * * `projects/{project_number}` * `projects/{project_id}` *
57   * `folders/{folder_id}` * `organizations/{organization_id}`
58   * @param array $optParams Optional parameters.
59   *
60   * @opt_param int pageSize Unused. The size of the page to be returned.
61   * @opt_param string pageToken Unused. A page token used to retrieve the next
62   * page.
63   * @opt_param string view The SettingView for this request.
64   * @return GoogleCloudResourcesettingsV1ListSettingsResponse
65   */
66  public function listOrganizationsSettings($parent, $optParams = [])
67  {
68    $params = ['parent' => $parent];
69    $params = array_merge($params, $optParams);
70    return $this->call('list', [$params], GoogleCloudResourcesettingsV1ListSettingsResponse::class);
71  }
72  /**
73   * Updates a specified setting. Returns a `google.rpc.Status` with
74   * `google.rpc.Code.NOT_FOUND` if the setting does not exist. Returns a
75   * `google.rpc.Status` with `google.rpc.Code.FAILED_PRECONDITION` if the setting
76   * is flagged as read only. Returns a `google.rpc.Status` with
77   * `google.rpc.Code.ABORTED` if the etag supplied in the request does not match
78   * the persisted etag of the setting value. On success, the response will
79   * contain only `name`, `local_value` and `etag`. The `metadata` and
80   * `effective_value` cannot be updated through this API. Note: the supplied
81   * setting will perform a full overwrite of the `local_value` field.
82   * (settings.patch)
83   *
84   * @param string $name The resource name of the setting. Must be in one of the
85   * following forms: * `projects/{project_number}/settings/{setting_name}` *
86   * `folders/{folder_id}/settings/{setting_name}` *
87   * `organizations/{organization_id}/settings/{setting_name}` For example,
88   * "/projects/123/settings/gcp-enableMyFeature"
89   * @param GoogleCloudResourcesettingsV1Setting $postBody
90   * @param array $optParams Optional parameters.
91   * @return GoogleCloudResourcesettingsV1Setting
92   */
93  public function patch($name, GoogleCloudResourcesettingsV1Setting $postBody, $optParams = [])
94  {
95    $params = ['name' => $name, 'postBody' => $postBody];
96    $params = array_merge($params, $optParams);
97    return $this->call('patch', [$params], GoogleCloudResourcesettingsV1Setting::class);
98  }
99}
100
101// Adding a class alias for backwards compatibility with the previous class name.
102class_alias(OrganizationsSettings::class, 'Google_Service_ResourceSettings_Resource_OrganizationsSettings');
103