[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\AlertCenter\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\AlertCenter\Alert;
|
---|
| 21 | use Google\Service\AlertCenter\AlertMetadata;
|
---|
| 22 | use Google\Service\AlertCenter\AlertcenterEmpty;
|
---|
| 23 | use Google\Service\AlertCenter\BatchDeleteAlertsRequest;
|
---|
| 24 | use Google\Service\AlertCenter\BatchDeleteAlertsResponse;
|
---|
| 25 | use Google\Service\AlertCenter\BatchUndeleteAlertsRequest;
|
---|
| 26 | use Google\Service\AlertCenter\BatchUndeleteAlertsResponse;
|
---|
| 27 | use Google\Service\AlertCenter\ListAlertsResponse;
|
---|
| 28 | use Google\Service\AlertCenter\UndeleteAlertRequest;
|
---|
| 29 |
|
---|
| 30 | /**
|
---|
| 31 | * The "alerts" collection of methods.
|
---|
| 32 | * Typical usage is:
|
---|
| 33 | * <code>
|
---|
| 34 | * $alertcenterService = new Google\Service\AlertCenter(...);
|
---|
| 35 | * $alerts = $alertcenterService->alerts;
|
---|
| 36 | * </code>
|
---|
| 37 | */
|
---|
| 38 | class Alerts extends \Google\Service\Resource
|
---|
| 39 | {
|
---|
| 40 | /**
|
---|
| 41 | * Performs batch delete operation on alerts. (alerts.batchDelete)
|
---|
| 42 | *
|
---|
| 43 | * @param BatchDeleteAlertsRequest $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | * @return BatchDeleteAlertsResponse
|
---|
| 46 | * @throws \Google\Service\Exception
|
---|
| 47 | */
|
---|
| 48 | public function batchDelete(BatchDeleteAlertsRequest $postBody, $optParams = [])
|
---|
| 49 | {
|
---|
| 50 | $params = ['postBody' => $postBody];
|
---|
| 51 | $params = array_merge($params, $optParams);
|
---|
| 52 | return $this->call('batchDelete', [$params], BatchDeleteAlertsResponse::class);
|
---|
| 53 | }
|
---|
| 54 | /**
|
---|
| 55 | * Performs batch undelete operation on alerts. (alerts.batchUndelete)
|
---|
| 56 | *
|
---|
| 57 | * @param BatchUndeleteAlertsRequest $postBody
|
---|
| 58 | * @param array $optParams Optional parameters.
|
---|
| 59 | * @return BatchUndeleteAlertsResponse
|
---|
| 60 | * @throws \Google\Service\Exception
|
---|
| 61 | */
|
---|
| 62 | public function batchUndelete(BatchUndeleteAlertsRequest $postBody, $optParams = [])
|
---|
| 63 | {
|
---|
| 64 | $params = ['postBody' => $postBody];
|
---|
| 65 | $params = array_merge($params, $optParams);
|
---|
| 66 | return $this->call('batchUndelete', [$params], BatchUndeleteAlertsResponse::class);
|
---|
| 67 | }
|
---|
| 68 | /**
|
---|
| 69 | * Marks the specified alert for deletion. An alert that has been marked for
|
---|
| 70 | * deletion is removed from Alert Center after 30 days. Marking an alert for
|
---|
| 71 | * deletion has no effect on an alert which has already been marked for
|
---|
| 72 | * deletion. Attempting to mark a nonexistent alert for deletion results in a
|
---|
| 73 | * `NOT_FOUND` error. (alerts.delete)
|
---|
| 74 | *
|
---|
| 75 | * @param string $alertId Required. The identifier of the alert to delete.
|
---|
| 76 | * @param array $optParams Optional parameters.
|
---|
| 77 | *
|
---|
| 78 | * @opt_param string customerId Optional. The unique identifier of the Google
|
---|
| 79 | * Workspace account of the customer the alert is associated with. The
|
---|
| 80 | * `customer_id` must have the initial "C" stripped (for example, `046psxkn`).
|
---|
| 81 | * Inferred from the caller identity if not provided. [Find your customer
|
---|
| 82 | * ID](https://support.google.com/cloudidentity/answer/10070793).
|
---|
| 83 | * @return AlertcenterEmpty
|
---|
| 84 | * @throws \Google\Service\Exception
|
---|
| 85 | */
|
---|
| 86 | public function delete($alertId, $optParams = [])
|
---|
| 87 | {
|
---|
| 88 | $params = ['alertId' => $alertId];
|
---|
| 89 | $params = array_merge($params, $optParams);
|
---|
| 90 | return $this->call('delete', [$params], AlertcenterEmpty::class);
|
---|
| 91 | }
|
---|
| 92 | /**
|
---|
| 93 | * Gets the specified alert. Attempting to get a nonexistent alert returns
|
---|
| 94 | * `NOT_FOUND` error. (alerts.get)
|
---|
| 95 | *
|
---|
| 96 | * @param string $alertId Required. The identifier of the alert to retrieve.
|
---|
| 97 | * @param array $optParams Optional parameters.
|
---|
| 98 | *
|
---|
| 99 | * @opt_param string customerId Optional. The unique identifier of the Google
|
---|
| 100 | * Workspace account of the customer the alert is associated with. The
|
---|
| 101 | * `customer_id` must have the initial "C" stripped (for example, `046psxkn`).
|
---|
| 102 | * Inferred from the caller identity if not provided. [Find your customer
|
---|
| 103 | * ID](https://support.google.com/cloudidentity/answer/10070793).
|
---|
| 104 | * @return Alert
|
---|
| 105 | * @throws \Google\Service\Exception
|
---|
| 106 | */
|
---|
| 107 | public function get($alertId, $optParams = [])
|
---|
| 108 | {
|
---|
| 109 | $params = ['alertId' => $alertId];
|
---|
| 110 | $params = array_merge($params, $optParams);
|
---|
| 111 | return $this->call('get', [$params], Alert::class);
|
---|
| 112 | }
|
---|
| 113 | /**
|
---|
| 114 | * Returns the metadata of an alert. Attempting to get metadata for a non-
|
---|
| 115 | * existent alert returns `NOT_FOUND` error. (alerts.getMetadata)
|
---|
| 116 | *
|
---|
| 117 | * @param string $alertId Required. The identifier of the alert this metadata
|
---|
| 118 | * belongs to.
|
---|
| 119 | * @param array $optParams Optional parameters.
|
---|
| 120 | *
|
---|
| 121 | * @opt_param string customerId Optional. The unique identifier of the Google
|
---|
| 122 | * Workspace account of the customer the alert metadata is associated with. The
|
---|
| 123 | * `customer_id` must have the initial "C" stripped (for example, `046psxkn`).
|
---|
| 124 | * Inferred from the caller identity if not provided. [Find your customer
|
---|
| 125 | * ID](https://support.google.com/cloudidentity/answer/10070793).
|
---|
| 126 | * @return AlertMetadata
|
---|
| 127 | * @throws \Google\Service\Exception
|
---|
| 128 | */
|
---|
| 129 | public function getMetadata($alertId, $optParams = [])
|
---|
| 130 | {
|
---|
| 131 | $params = ['alertId' => $alertId];
|
---|
| 132 | $params = array_merge($params, $optParams);
|
---|
| 133 | return $this->call('getMetadata', [$params], AlertMetadata::class);
|
---|
| 134 | }
|
---|
| 135 | /**
|
---|
| 136 | * Lists the alerts. (alerts.listAlerts)
|
---|
| 137 | *
|
---|
| 138 | * @param array $optParams Optional parameters.
|
---|
| 139 | *
|
---|
| 140 | * @opt_param string customerId Optional. The unique identifier of the Google
|
---|
| 141 | * Workspace account of the customer the alerts are associated with. The
|
---|
| 142 | * `customer_id` must have the initial "C" stripped (for example, `046psxkn`).
|
---|
| 143 | * Inferred from the caller identity if not provided. [Find your customer
|
---|
| 144 | * ID](https://support.google.com/cloudidentity/answer/10070793).
|
---|
| 145 | * @opt_param string filter Optional. A query string for filtering alert
|
---|
| 146 | * results. For more details, see [Query
|
---|
| 147 | * filters](https://developers.google.com/admin-sdk/alertcenter/guides/query-
|
---|
| 148 | * filters) and [Supported query filter
|
---|
| 149 | * fields](https://developers.google.com/admin-sdk/alertcenter/reference/filter-
|
---|
| 150 | * fields#alerts.list).
|
---|
| 151 | * @opt_param string orderBy Optional. The sort order of the list results. If
|
---|
| 152 | * not specified results may be returned in arbitrary order. You can sort the
|
---|
| 153 | * results in descending order based on the creation timestamp using
|
---|
| 154 | * `order_by="create_time desc"`. Currently, supported sorting are `create_time
|
---|
| 155 | * asc`, `create_time desc`, `update_time desc`
|
---|
| 156 | * @opt_param int pageSize Optional. The requested page size. Server may return
|
---|
| 157 | * fewer items than requested. If unspecified, server picks an appropriate
|
---|
| 158 | * default.
|
---|
| 159 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
| 160 | * the server should return. If empty, a new iteration is started. To continue
|
---|
| 161 | * an iteration, pass in the value from the previous ListAlertsResponse's
|
---|
| 162 | * next_page_token field.
|
---|
| 163 | * @return ListAlertsResponse
|
---|
| 164 | * @throws \Google\Service\Exception
|
---|
| 165 | */
|
---|
| 166 | public function listAlerts($optParams = [])
|
---|
| 167 | {
|
---|
| 168 | $params = [];
|
---|
| 169 | $params = array_merge($params, $optParams);
|
---|
| 170 | return $this->call('list', [$params], ListAlertsResponse::class);
|
---|
| 171 | }
|
---|
| 172 | /**
|
---|
| 173 | * Restores, or "undeletes", an alert that was marked for deletion within the
|
---|
| 174 | * past 30 days. Attempting to undelete an alert which was marked for deletion
|
---|
| 175 | * over 30 days ago (which has been removed from the Alert Center database) or a
|
---|
| 176 | * nonexistent alert returns a `NOT_FOUND` error. Attempting to undelete an
|
---|
| 177 | * alert which has not been marked for deletion has no effect. (alerts.undelete)
|
---|
| 178 | *
|
---|
| 179 | * @param string $alertId Required. The identifier of the alert to undelete.
|
---|
| 180 | * @param UndeleteAlertRequest $postBody
|
---|
| 181 | * @param array $optParams Optional parameters.
|
---|
| 182 | * @return Alert
|
---|
| 183 | * @throws \Google\Service\Exception
|
---|
| 184 | */
|
---|
| 185 | public function undelete($alertId, UndeleteAlertRequest $postBody, $optParams = [])
|
---|
| 186 | {
|
---|
| 187 | $params = ['alertId' => $alertId, 'postBody' => $postBody];
|
---|
| 188 | $params = array_merge($params, $optParams);
|
---|
| 189 | return $this->call('undelete', [$params], Alert::class);
|
---|
| 190 | }
|
---|
| 191 | }
|
---|
| 192 |
|
---|
| 193 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 194 | class_alias(Alerts::class, 'Google_Service_AlertCenter_Resource_Alerts');
|
---|