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\AlertCenter\Resource;
19
20use Google\Service\AlertCenter\AlertFeedback;
21use Google\Service\AlertCenter\ListAlertFeedbackResponse;
22
23/**
24 * The "feedback" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $alertcenterService = new Google\Service\AlertCenter(...);
28 *   $feedback = $alertcenterService->feedback;
29 *  </code>
30 */
31class AlertsFeedback extends \Google\Service\Resource
32{
33  /**
34   * Creates new feedback for an alert. Attempting to create a feedback for a non-
35   * existent alert returns `NOT_FOUND` error. Attempting to create a feedback for
36   * an alert that is marked for deletion returns `FAILED_PRECONDITION' error.
37   * (feedback.create)
38   *
39   * @param string $alertId Required. The identifier of the alert this feedback
40   * belongs to.
41   * @param AlertFeedback $postBody
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param string customerId Optional. The unique identifier of the Google
45   * Workspace organization account of the customer the alert is associated with.
46   * Inferred from the caller identity if not provided.
47   * @return AlertFeedback
48   */
49  public function create($alertId, AlertFeedback $postBody, $optParams = [])
50  {
51    $params = ['alertId' => $alertId, 'postBody' => $postBody];
52    $params = array_merge($params, $optParams);
53    return $this->call('create', [$params], AlertFeedback::class);
54  }
55  /**
56   * Lists all the feedback for an alert. Attempting to list feedbacks for a non-
57   * existent alert returns `NOT_FOUND` error. (feedback.listAlertsFeedback)
58   *
59   * @param string $alertId Required. The alert identifier. The "-" wildcard could
60   * be used to represent all alerts.
61   * @param array $optParams Optional parameters.
62   *
63   * @opt_param string customerId Optional. The unique identifier of the Google
64   * Workspace organization account of the customer the alert feedback are
65   * associated with. Inferred from the caller identity if not provided.
66   * @opt_param string filter Optional. A query string for filtering alert
67   * feedback results. For more details, see [Query
68   * filters](https://developers.google.com/admin-sdk/alertcenter/guides/query-
69   * filters) and [Supported query filter fields](https://developers.google.com
70   * /admin-sdk/alertcenter/reference/filter-fields#alerts.feedback.list).
71   * @return ListAlertFeedbackResponse
72   */
73  public function listAlertsFeedback($alertId, $optParams = [])
74  {
75    $params = ['alertId' => $alertId];
76    $params = array_merge($params, $optParams);
77    return $this->call('list', [$params], ListAlertFeedbackResponse::class);
78  }
79}
80
81// Adding a class alias for backwards compatibility with the previous class name.
82class_alias(AlertsFeedback::class, 'Google_Service_AlertCenter_Resource_AlertsFeedback');
83