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\MyBusinessNotificationSettings\Resource;
19
20use Google\Service\MyBusinessNotificationSettings\NotificationSetting;
21
22/**
23 * The "accounts" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $mybusinessnotificationsService = new Google\Service\MyBusinessNotificationSettings(...);
27 *   $accounts = $mybusinessnotificationsService->accounts;
28 *  </code>
29 */
30class Accounts extends \Google\Service\Resource
31{
32  /**
33   * Returns the pubsub notification settings for the account.
34   * (accounts.getNotificationSetting)
35   *
36   * @param string $name Required. The resource name of the notification setting
37   * we are trying to fetch.
38   * @param array $optParams Optional parameters.
39   * @return NotificationSetting
40   */
41  public function getNotificationSetting($name, $optParams = [])
42  {
43    $params = ['name' => $name];
44    $params = array_merge($params, $optParams);
45    return $this->call('getNotificationSetting', [$params], NotificationSetting::class);
46  }
47  /**
48   * Sets the pubsub notification setting for the account informing Google which
49   * topic to send pubsub notifications for. Use the notification_types field
50   * within notification_setting to manipulate the events an account wants to
51   * subscribe to. An account will only have one notification setting resource,
52   * and only one pubsub topic can be set. To delete the setting, update with an
53   * empty notification_types (accounts.updateNotificationSetting)
54   *
55   * @param string $name Required. The resource name this setting is for. This is
56   * of the form `accounts/{account_id}/notificationSetting`.
57   * @param NotificationSetting $postBody
58   * @param array $optParams Optional parameters.
59   *
60   * @opt_param string updateMask Required. The specific fields that should be
61   * updated. The only editable field is notification_setting.
62   * @return NotificationSetting
63   */
64  public function updateNotificationSetting($name, NotificationSetting $postBody, $optParams = [])
65  {
66    $params = ['name' => $name, 'postBody' => $postBody];
67    $params = array_merge($params, $optParams);
68    return $this->call('updateNotificationSetting', [$params], NotificationSetting::class);
69  }
70}
71
72// Adding a class alias for backwards compatibility with the previous class name.
73class_alias(Accounts::class, 'Google_Service_MyBusinessNotificationSettings_Resource_Accounts');
74