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\Directory\Resource;
19
20use Google\Service\Directory\CalendarResource;
21use Google\Service\Directory\CalendarResources;
22
23/**
24 * The "calendars" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adminService = new Google\Service\Directory(...);
28 *   $calendars = $adminService->calendars;
29 *  </code>
30 */
31class ResourcesCalendars extends \Google\Service\Resource
32{
33  /**
34   * Deletes a calendar resource. (calendars.delete)
35   *
36   * @param string $customer The unique ID for the customer's Google Workspace
37   * account. As an account administrator, you can also use the `my_customer`
38   * alias to represent your account's customer ID.
39   * @param string $calendarResourceId The unique ID of the calendar resource to
40   * delete.
41   * @param array $optParams Optional parameters.
42   */
43  public function delete($customer, $calendarResourceId, $optParams = [])
44  {
45    $params = ['customer' => $customer, 'calendarResourceId' => $calendarResourceId];
46    $params = array_merge($params, $optParams);
47    return $this->call('delete', [$params]);
48  }
49  /**
50   * Retrieves a calendar resource. (calendars.get)
51   *
52   * @param string $customer The unique ID for the customer's Google Workspace
53   * account. As an account administrator, you can also use the `my_customer`
54   * alias to represent your account's customer ID.
55   * @param string $calendarResourceId The unique ID of the calendar resource to
56   * retrieve.
57   * @param array $optParams Optional parameters.
58   * @return CalendarResource
59   */
60  public function get($customer, $calendarResourceId, $optParams = [])
61  {
62    $params = ['customer' => $customer, 'calendarResourceId' => $calendarResourceId];
63    $params = array_merge($params, $optParams);
64    return $this->call('get', [$params], CalendarResource::class);
65  }
66  /**
67   * Inserts a calendar resource. (calendars.insert)
68   *
69   * @param string $customer The unique ID for the customer's Google Workspace
70   * account. As an account administrator, you can also use the `my_customer`
71   * alias to represent your account's customer ID.
72   * @param CalendarResource $postBody
73   * @param array $optParams Optional parameters.
74   * @return CalendarResource
75   */
76  public function insert($customer, CalendarResource $postBody, $optParams = [])
77  {
78    $params = ['customer' => $customer, 'postBody' => $postBody];
79    $params = array_merge($params, $optParams);
80    return $this->call('insert', [$params], CalendarResource::class);
81  }
82  /**
83   * Retrieves a list of calendar resources for an account.
84   * (calendars.listResourcesCalendars)
85   *
86   * @param string $customer The unique ID for the customer's Google Workspace
87   * account. As an account administrator, you can also use the `my_customer`
88   * alias to represent your account's customer ID.
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param int maxResults Maximum number of results to return.
92   * @opt_param string orderBy Field(s) to sort results by in either ascending or
93   * descending order. Supported fields include `resourceId`, `resourceName`,
94   * `capacity`, `buildingId`, and `floorName`. If no order is specified, defaults
95   * to ascending. Should be of the form "field [asc|desc], field [asc|desc],
96   * ...". For example `buildingId, capacity desc` would return results sorted
97   * first by `buildingId` in ascending order then by `capacity` in descending
98   * order.
99   * @opt_param string pageToken Token to specify the next page in the list.
100   * @opt_param string query String query used to filter results. Should be of the
101   * form "field operator value" where field can be any of supported fields and
102   * operators can be any of supported operations. Operators include '=' for exact
103   * match, '!=' for mismatch and ':' for prefix match or HAS match where
104   * applicable. For prefix match, the value should always be followed by a *.
105   * Logical operators NOT and AND are supported (in this order of precedence).
106   * Supported fields include `generatedResourceName`, `name`, `buildingId`,
107   * `floor_name`, `capacity`, `featureInstances.feature.name`, `resourceEmail`,
108   * `resourceCategory`. For example `buildingId=US-NYC-9TH AND
109   * featureInstances.feature.name:Phone`.
110   * @return CalendarResources
111   */
112  public function listResourcesCalendars($customer, $optParams = [])
113  {
114    $params = ['customer' => $customer];
115    $params = array_merge($params, $optParams);
116    return $this->call('list', [$params], CalendarResources::class);
117  }
118  /**
119   * Patches a calendar resource. (calendars.patch)
120   *
121   * @param string $customer The unique ID for the customer's Google Workspace
122   * account. As an account administrator, you can also use the `my_customer`
123   * alias to represent your account's customer ID.
124   * @param string $calendarResourceId The unique ID of the calendar resource to
125   * update.
126   * @param CalendarResource $postBody
127   * @param array $optParams Optional parameters.
128   * @return CalendarResource
129   */
130  public function patch($customer, $calendarResourceId, CalendarResource $postBody, $optParams = [])
131  {
132    $params = ['customer' => $customer, 'calendarResourceId' => $calendarResourceId, 'postBody' => $postBody];
133    $params = array_merge($params, $optParams);
134    return $this->call('patch', [$params], CalendarResource::class);
135  }
136  /**
137   * Updates a calendar resource. This method supports patch semantics, meaning
138   * you only need to include the fields you wish to update. Fields that are not
139   * present in the request will be preserved. (calendars.update)
140   *
141   * @param string $customer The unique ID for the customer's Google Workspace
142   * account. As an account administrator, you can also use the `my_customer`
143   * alias to represent your account's customer ID.
144   * @param string $calendarResourceId The unique ID of the calendar resource to
145   * update.
146   * @param CalendarResource $postBody
147   * @param array $optParams Optional parameters.
148   * @return CalendarResource
149   */
150  public function update($customer, $calendarResourceId, CalendarResource $postBody, $optParams = [])
151  {
152    $params = ['customer' => $customer, 'calendarResourceId' => $calendarResourceId, 'postBody' => $postBody];
153    $params = array_merge($params, $optParams);
154    return $this->call('update', [$params], CalendarResource::class);
155  }
156}
157
158// Adding a class alias for backwards compatibility with the previous class name.
159class_alias(ResourcesCalendars::class, 'Google_Service_Directory_Resource_ResourcesCalendars');
160