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\Calendar;
21
22/**
23 * The "calendars" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $calendarService = new Google\Service\Calendar(...);
27 *   $calendars = $calendarService->calendars;
28 *  </code>
29 */
30class Calendars extends \Google\Service\Resource
31{
32  /**
33   * Clears a primary calendar. This operation deletes all events associated with
34   * the primary calendar of an account. (calendars.clear)
35   *
36   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
37   * the calendarList.list method. If you want to access the primary calendar of
38   * the currently logged in user, use the "primary" keyword.
39   * @param array $optParams Optional parameters.
40   */
41  public function clear($calendarId, $optParams = [])
42  {
43    $params = ['calendarId' => $calendarId];
44    $params = array_merge($params, $optParams);
45    return $this->call('clear', [$params]);
46  }
47  /**
48   * Deletes a secondary calendar. Use calendars.clear for clearing all events on
49   * primary calendars. (calendars.delete)
50   *
51   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
52   * the calendarList.list method. If you want to access the primary calendar of
53   * the currently logged in user, use the "primary" keyword.
54   * @param array $optParams Optional parameters.
55   */
56  public function delete($calendarId, $optParams = [])
57  {
58    $params = ['calendarId' => $calendarId];
59    $params = array_merge($params, $optParams);
60    return $this->call('delete', [$params]);
61  }
62  /**
63   * Returns metadata for a calendar. (calendars.get)
64   *
65   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
66   * the calendarList.list method. If you want to access the primary calendar of
67   * the currently logged in user, use the "primary" keyword.
68   * @param array $optParams Optional parameters.
69   * @return Calendar
70   */
71  public function get($calendarId, $optParams = [])
72  {
73    $params = ['calendarId' => $calendarId];
74    $params = array_merge($params, $optParams);
75    return $this->call('get', [$params], Calendar::class);
76  }
77  /**
78   * Creates a secondary calendar. (calendars.insert)
79   *
80   * @param Calendar $postBody
81   * @param array $optParams Optional parameters.
82   * @return Calendar
83   */
84  public function insert(Calendar $postBody, $optParams = [])
85  {
86    $params = ['postBody' => $postBody];
87    $params = array_merge($params, $optParams);
88    return $this->call('insert', [$params], Calendar::class);
89  }
90  /**
91   * Updates metadata for a calendar. This method supports patch semantics.
92   * (calendars.patch)
93   *
94   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
95   * the calendarList.list method. If you want to access the primary calendar of
96   * the currently logged in user, use the "primary" keyword.
97   * @param Calendar $postBody
98   * @param array $optParams Optional parameters.
99   * @return Calendar
100   */
101  public function patch($calendarId, Calendar $postBody, $optParams = [])
102  {
103    $params = ['calendarId' => $calendarId, 'postBody' => $postBody];
104    $params = array_merge($params, $optParams);
105    return $this->call('patch', [$params], Calendar::class);
106  }
107  /**
108   * Updates metadata for a calendar. (calendars.update)
109   *
110   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
111   * the calendarList.list method. If you want to access the primary calendar of
112   * the currently logged in user, use the "primary" keyword.
113   * @param Calendar $postBody
114   * @param array $optParams Optional parameters.
115   * @return Calendar
116   */
117  public function update($calendarId, Calendar $postBody, $optParams = [])
118  {
119    $params = ['calendarId' => $calendarId, 'postBody' => $postBody];
120    $params = array_merge($params, $optParams);
121    return $this->call('update', [$params], Calendar::class);
122  }
123}
124
125// Adding a class alias for backwards compatibility with the previous class name.
126class_alias(Calendars::class, 'Google_Service_Calendar_Resource_Calendars');
127