[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\Storage\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Storage\Notification;
|
---|
| 21 | use Google\Service\Storage\Notifications as NotificationsModel;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "notifications" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $storageService = new Google\Service\Storage(...);
|
---|
| 28 | * $notifications = $storageService->notifications;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class Notifications extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Permanently deletes a notification subscription. (notifications.delete)
|
---|
| 35 | *
|
---|
| 36 | * @param string $bucket The parent bucket of the notification.
|
---|
| 37 | * @param string $notification ID of the notification to delete.
|
---|
| 38 | * @param array $optParams Optional parameters.
|
---|
| 39 | *
|
---|
| 40 | * @opt_param string userProject The project to be billed for this request.
|
---|
| 41 | * Required for Requester Pays buckets.
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function delete($bucket, $notification, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['bucket' => $bucket, 'notification' => $notification];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('delete', [$params]);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * View a notification configuration. (notifications.get)
|
---|
| 52 | *
|
---|
| 53 | * @param string $bucket The parent bucket of the notification.
|
---|
| 54 | * @param string $notification Notification ID
|
---|
| 55 | * @param array $optParams Optional parameters.
|
---|
| 56 | *
|
---|
| 57 | * @opt_param string userProject The project to be billed for this request.
|
---|
| 58 | * Required for Requester Pays buckets.
|
---|
| 59 | * @return Notification
|
---|
| 60 | * @throws \Google\Service\Exception
|
---|
| 61 | */
|
---|
| 62 | public function get($bucket, $notification, $optParams = [])
|
---|
| 63 | {
|
---|
| 64 | $params = ['bucket' => $bucket, 'notification' => $notification];
|
---|
| 65 | $params = array_merge($params, $optParams);
|
---|
| 66 | return $this->call('get', [$params], Notification::class);
|
---|
| 67 | }
|
---|
| 68 | /**
|
---|
| 69 | * Creates a notification subscription for a given bucket.
|
---|
| 70 | * (notifications.insert)
|
---|
| 71 | *
|
---|
| 72 | * @param string $bucket The parent bucket of the notification.
|
---|
| 73 | * @param Notification $postBody
|
---|
| 74 | * @param array $optParams Optional parameters.
|
---|
| 75 | *
|
---|
| 76 | * @opt_param string userProject The project to be billed for this request.
|
---|
| 77 | * Required for Requester Pays buckets.
|
---|
| 78 | * @return Notification
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function insert($bucket, Notification $postBody, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['bucket' => $bucket, 'postBody' => $postBody];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('insert', [$params], Notification::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Retrieves a list of notification subscriptions for a given bucket.
|
---|
| 89 | * (notifications.listNotifications)
|
---|
| 90 | *
|
---|
| 91 | * @param string $bucket Name of a Google Cloud Storage bucket.
|
---|
| 92 | * @param array $optParams Optional parameters.
|
---|
| 93 | *
|
---|
| 94 | * @opt_param string userProject The project to be billed for this request.
|
---|
| 95 | * Required for Requester Pays buckets.
|
---|
| 96 | * @return NotificationsModel
|
---|
| 97 | * @throws \Google\Service\Exception
|
---|
| 98 | */
|
---|
| 99 | public function listNotifications($bucket, $optParams = [])
|
---|
| 100 | {
|
---|
| 101 | $params = ['bucket' => $bucket];
|
---|
| 102 | $params = array_merge($params, $optParams);
|
---|
| 103 | return $this->call('list', [$params], NotificationsModel::class);
|
---|
| 104 | }
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 108 | class_alias(Notifications::class, 'Google_Service_Storage_Resource_Notifications');
|
---|