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\Calendar\Resource;
19
20use Google\Service\Calendar\Channel;
21use Google\Service\Calendar\Setting;
22use Google\Service\Calendar\Settings as SettingsModel;
23
24/**
25 * The "settings" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $calendarService = new Google\Service\Calendar(...);
29 *   $settings = $calendarService->settings;
30 *  </code>
31 */
32class Settings extends \Google\Service\Resource
33{
34  /**
35   * Returns a single user setting. (settings.get)
36   *
37   * @param string $setting The id of the user setting.
38   * @param array $optParams Optional parameters.
39   * @return Setting
40   */
41  public function get($setting, $optParams = [])
42  {
43    $params = ['setting' => $setting];
44    $params = array_merge($params, $optParams);
45    return $this->call('get', [$params], Setting::class);
46  }
47  /**
48   * Returns all user settings for the authenticated user. (settings.listSettings)
49   *
50   * @param array $optParams Optional parameters.
51   *
52   * @opt_param int maxResults Maximum number of entries returned on one result
53   * page. By default the value is 100 entries. The page size can never be larger
54   * than 250 entries. Optional.
55   * @opt_param string pageToken Token specifying which result page to return.
56   * Optional.
57   * @opt_param string syncToken Token obtained from the nextSyncToken field
58   * returned on the last page of results from the previous list request. It makes
59   * the result of this list request contain only entries that have changed since
60   * then. If the syncToken expires, the server will respond with a 410 GONE
61   * response code and the client should clear its storage and perform a full
62   * synchronization without any syncToken. Learn more about incremental
63   * synchronization. Optional. The default is to return all entries.
64   * @return SettingsModel
65   */
66  public function listSettings($optParams = [])
67  {
68    $params = [];
69    $params = array_merge($params, $optParams);
70    return $this->call('list', [$params], SettingsModel::class);
71  }
72  /**
73   * Watch for changes to Settings resources. (settings.watch)
74   *
75   * @param Channel $postBody
76   * @param array $optParams Optional parameters.
77   *
78   * @opt_param int maxResults Maximum number of entries returned on one result
79   * page. By default the value is 100 entries. The page size can never be larger
80   * than 250 entries. Optional.
81   * @opt_param string pageToken Token specifying which result page to return.
82   * Optional.
83   * @opt_param string syncToken Token obtained from the nextSyncToken field
84   * returned on the last page of results from the previous list request. It makes
85   * the result of this list request contain only entries that have changed since
86   * then. If the syncToken expires, the server will respond with a 410 GONE
87   * response code and the client should clear its storage and perform a full
88   * synchronization without any syncToken. Learn more about incremental
89   * synchronization. Optional. The default is to return all entries.
90   * @return Channel
91   */
92  public function watch(Channel $postBody, $optParams = [])
93  {
94    $params = ['postBody' => $postBody];
95    $params = array_merge($params, $optParams);
96    return $this->call('watch', [$params], Channel::class);
97  }
98}
99
100// Adding a class alias for backwards compatibility with the previous class name.
101class_alias(Settings::class, 'Google_Service_Calendar_Resource_Settings');
102