[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\MyBusinessNotificationSettings\Resource;
|
---|
| 19 |
|
---|
| 20 | use 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 | */
|
---|
| 30 | class 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 | * @throws \Google\Service\Exception
|
---|
| 41 | */
|
---|
| 42 | public function getNotificationSetting($name, $optParams = [])
|
---|
| 43 | {
|
---|
| 44 | $params = ['name' => $name];
|
---|
| 45 | $params = array_merge($params, $optParams);
|
---|
| 46 | return $this->call('getNotificationSetting', [$params], NotificationSetting::class);
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * Sets the pubsub notification setting for the account informing Google which
|
---|
| 50 | * topic to send pubsub notifications for. Use the notification_types field
|
---|
| 51 | * within notification_setting to manipulate the events an account wants to
|
---|
| 52 | * subscribe to. An account will only have one notification setting resource,
|
---|
| 53 | * and only one pubsub topic can be set. To delete the setting, update with an
|
---|
| 54 | * empty notification_types (accounts.updateNotificationSetting)
|
---|
| 55 | *
|
---|
| 56 | * @param string $name Required. The resource name this setting is for. This is
|
---|
| 57 | * of the form `accounts/{account_id}/notificationSetting`.
|
---|
| 58 | * @param NotificationSetting $postBody
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | *
|
---|
| 61 | * @opt_param string updateMask Required. The specific fields that should be
|
---|
| 62 | * updated. The only editable field is notification_setting.
|
---|
| 63 | * @return NotificationSetting
|
---|
| 64 | * @throws \Google\Service\Exception
|
---|
| 65 | */
|
---|
| 66 | public function updateNotificationSetting($name, NotificationSetting $postBody, $optParams = [])
|
---|
| 67 | {
|
---|
| 68 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 69 | $params = array_merge($params, $optParams);
|
---|
| 70 | return $this->call('updateNotificationSetting', [$params], NotificationSetting::class);
|
---|
| 71 | }
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 75 | class_alias(Accounts::class, 'Google_Service_MyBusinessNotificationSettings_Resource_Accounts');
|
---|