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\Gmail\Resource;
19
20use Google\Service\Gmail\Profile;
21use Google\Service\Gmail\WatchRequest;
22use Google\Service\Gmail\WatchResponse;
23
24/**
25 * The "users" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $gmailService = new Google\Service\Gmail(...);
29 *   $users = $gmailService->users;
30 *  </code>
31 */
32class Users extends \Google\Service\Resource
33{
34  /**
35   * Gets the current user's Gmail profile. (users.getProfile)
36   *
37   * @param string $userId The user's email address. The special value `me` can be
38   * used to indicate the authenticated user.
39   * @param array $optParams Optional parameters.
40   * @return Profile
41   */
42  public function getProfile($userId, $optParams = [])
43  {
44    $params = ['userId' => $userId];
45    $params = array_merge($params, $optParams);
46    return $this->call('getProfile', [$params], Profile::class);
47  }
48  /**
49   * Stop receiving push notifications for the given user mailbox. (users.stop)
50   *
51   * @param string $userId The user's email address. The special value `me` can be
52   * used to indicate the authenticated user.
53   * @param array $optParams Optional parameters.
54   */
55  public function stop($userId, $optParams = [])
56  {
57    $params = ['userId' => $userId];
58    $params = array_merge($params, $optParams);
59    return $this->call('stop', [$params]);
60  }
61  /**
62   * Set up or update a push notification watch on the given user mailbox.
63   * (users.watch)
64   *
65   * @param string $userId The user's email address. The special value `me` can be
66   * used to indicate the authenticated user.
67   * @param WatchRequest $postBody
68   * @param array $optParams Optional parameters.
69   * @return WatchResponse
70   */
71  public function watch($userId, WatchRequest $postBody, $optParams = [])
72  {
73    $params = ['userId' => $userId, 'postBody' => $postBody];
74    $params = array_merge($params, $optParams);
75    return $this->call('watch', [$params], WatchResponse::class);
76  }
77}
78
79// Adding a class alias for backwards compatibility with the previous class name.
80class_alias(Users::class, 'Google_Service_Gmail_Resource_Users');
81