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\Acl as AclModel;
21use Google\Service\Calendar\AclRule;
22use Google\Service\Calendar\Channel;
23
24/**
25 * The "acl" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $calendarService = new Google\Service\Calendar(...);
29 *   $acl = $calendarService->acl;
30 *  </code>
31 */
32class Acl extends \Google\Service\Resource
33{
34  /**
35   * Deletes an access control rule. (acl.delete)
36   *
37   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
38   * the calendarList.list method. If you want to access the primary calendar of
39   * the currently logged in user, use the "primary" keyword.
40   * @param string $ruleId ACL rule identifier.
41   * @param array $optParams Optional parameters.
42   */
43  public function delete($calendarId, $ruleId, $optParams = [])
44  {
45    $params = ['calendarId' => $calendarId, 'ruleId' => $ruleId];
46    $params = array_merge($params, $optParams);
47    return $this->call('delete', [$params]);
48  }
49  /**
50   * Returns an access control rule. (acl.get)
51   *
52   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
53   * the calendarList.list method. If you want to access the primary calendar of
54   * the currently logged in user, use the "primary" keyword.
55   * @param string $ruleId ACL rule identifier.
56   * @param array $optParams Optional parameters.
57   * @return AclRule
58   */
59  public function get($calendarId, $ruleId, $optParams = [])
60  {
61    $params = ['calendarId' => $calendarId, 'ruleId' => $ruleId];
62    $params = array_merge($params, $optParams);
63    return $this->call('get', [$params], AclRule::class);
64  }
65  /**
66   * Creates an access control rule. (acl.insert)
67   *
68   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
69   * the calendarList.list method. If you want to access the primary calendar of
70   * the currently logged in user, use the "primary" keyword.
71   * @param AclRule $postBody
72   * @param array $optParams Optional parameters.
73   *
74   * @opt_param bool sendNotifications Whether to send notifications about the
75   * calendar sharing change. Optional. The default is True.
76   * @return AclRule
77   */
78  public function insert($calendarId, AclRule $postBody, $optParams = [])
79  {
80    $params = ['calendarId' => $calendarId, 'postBody' => $postBody];
81    $params = array_merge($params, $optParams);
82    return $this->call('insert', [$params], AclRule::class);
83  }
84  /**
85   * Returns the rules in the access control list for the calendar. (acl.listAcl)
86   *
87   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
88   * the calendarList.list method. If you want to access the primary calendar of
89   * the currently logged in user, use the "primary" keyword.
90   * @param array $optParams Optional parameters.
91   *
92   * @opt_param int maxResults Maximum number of entries returned on one result
93   * page. By default the value is 100 entries. The page size can never be larger
94   * than 250 entries. Optional.
95   * @opt_param string pageToken Token specifying which result page to return.
96   * Optional.
97   * @opt_param bool showDeleted Whether to include deleted ACLs in the result.
98   * Deleted ACLs are represented by role equal to "none". Deleted ACLs will
99   * always be included if syncToken is provided. Optional. The default is False.
100   * @opt_param string syncToken Token obtained from the nextSyncToken field
101   * returned on the last page of results from the previous list request. It makes
102   * the result of this list request contain only entries that have changed since
103   * then. All entries deleted since the previous list request will always be in
104   * the result set and it is not allowed to set showDeleted to False. If the
105   * syncToken expires, the server will respond with a 410 GONE response code and
106   * the client should clear its storage and perform a full synchronization
107   * without any syncToken. Learn more about incremental synchronization.
108   * Optional. The default is to return all entries.
109   * @return AclModel
110   */
111  public function listAcl($calendarId, $optParams = [])
112  {
113    $params = ['calendarId' => $calendarId];
114    $params = array_merge($params, $optParams);
115    return $this->call('list', [$params], AclModel::class);
116  }
117  /**
118   * Updates an access control rule. This method supports patch semantics.
119   * (acl.patch)
120   *
121   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
122   * the calendarList.list method. If you want to access the primary calendar of
123   * the currently logged in user, use the "primary" keyword.
124   * @param string $ruleId ACL rule identifier.
125   * @param AclRule $postBody
126   * @param array $optParams Optional parameters.
127   *
128   * @opt_param bool sendNotifications Whether to send notifications about the
129   * calendar sharing change. Note that there are no notifications on access
130   * removal. Optional. The default is True.
131   * @return AclRule
132   */
133  public function patch($calendarId, $ruleId, AclRule $postBody, $optParams = [])
134  {
135    $params = ['calendarId' => $calendarId, 'ruleId' => $ruleId, 'postBody' => $postBody];
136    $params = array_merge($params, $optParams);
137    return $this->call('patch', [$params], AclRule::class);
138  }
139  /**
140   * Updates an access control rule. (acl.update)
141   *
142   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
143   * the calendarList.list method. If you want to access the primary calendar of
144   * the currently logged in user, use the "primary" keyword.
145   * @param string $ruleId ACL rule identifier.
146   * @param AclRule $postBody
147   * @param array $optParams Optional parameters.
148   *
149   * @opt_param bool sendNotifications Whether to send notifications about the
150   * calendar sharing change. Note that there are no notifications on access
151   * removal. Optional. The default is True.
152   * @return AclRule
153   */
154  public function update($calendarId, $ruleId, AclRule $postBody, $optParams = [])
155  {
156    $params = ['calendarId' => $calendarId, 'ruleId' => $ruleId, 'postBody' => $postBody];
157    $params = array_merge($params, $optParams);
158    return $this->call('update', [$params], AclRule::class);
159  }
160  /**
161   * Watch for changes to ACL resources. (acl.watch)
162   *
163   * @param string $calendarId Calendar identifier. To retrieve calendar IDs call
164   * the calendarList.list method. If you want to access the primary calendar of
165   * the currently logged in user, use the "primary" keyword.
166   * @param Channel $postBody
167   * @param array $optParams Optional parameters.
168   *
169   * @opt_param int maxResults Maximum number of entries returned on one result
170   * page. By default the value is 100 entries. The page size can never be larger
171   * than 250 entries. Optional.
172   * @opt_param string pageToken Token specifying which result page to return.
173   * Optional.
174   * @opt_param bool showDeleted Whether to include deleted ACLs in the result.
175   * Deleted ACLs are represented by role equal to "none". Deleted ACLs will
176   * always be included if syncToken is provided. Optional. The default is False.
177   * @opt_param string syncToken Token obtained from the nextSyncToken field
178   * returned on the last page of results from the previous list request. It makes
179   * the result of this list request contain only entries that have changed since
180   * then. All entries deleted since the previous list request will always be in
181   * the result set and it is not allowed to set showDeleted to False. If the
182   * syncToken expires, the server will respond with a 410 GONE response code and
183   * the client should clear its storage and perform a full synchronization
184   * without any syncToken. Learn more about incremental synchronization.
185   * Optional. The default is to return all entries.
186   * @return Channel
187   */
188  public function watch($calendarId, Channel $postBody, $optParams = [])
189  {
190    $params = ['calendarId' => $calendarId, 'postBody' => $postBody];
191    $params = array_merge($params, $optParams);
192    return $this->call('watch', [$params], Channel::class);
193  }
194}
195
196// Adding a class alias for backwards compatibility with the previous class name.
197class_alias(Acl::class, 'Google_Service_Calendar_Resource_Acl');
198