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\SecurityCommandCenter\Resource;
19
20use Google\Service\SecurityCommandCenter\ListNotificationConfigsResponse;
21use Google\Service\SecurityCommandCenter\NotificationConfig;
22use Google\Service\SecurityCommandCenter\SecuritycenterEmpty;
23
24/**
25 * The "notificationConfigs" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $securitycenterService = new Google\Service\SecurityCommandCenter(...);
29 *   $notificationConfigs = $securitycenterService->notificationConfigs;
30 *  </code>
31 */
32class OrganizationsNotificationConfigs extends \Google\Service\Resource
33{
34  /**
35   * Creates a notification config. (notificationConfigs.create)
36   *
37   * @param string $parent Required. Resource name of the new notification
38   * config's parent. Its format is "organizations/[organization_id]".
39   * @param NotificationConfig $postBody
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string configId Required. Unique identifier provided by the client
43   * within the parent scope. It must be between 1 and 128 characters, and
44   * contains alphanumeric characters, underscores or hyphens only.
45   * @return NotificationConfig
46   */
47  public function create($parent, NotificationConfig $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('create', [$params], NotificationConfig::class);
52  }
53  /**
54   * Deletes a notification config. (notificationConfigs.delete)
55   *
56   * @param string $name Required. Name of the notification config to delete. Its
57   * format is "organizations/[organization_id]/notificationConfigs/[config_id]".
58   * @param array $optParams Optional parameters.
59   * @return SecuritycenterEmpty
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], SecuritycenterEmpty::class);
66  }
67  /**
68   * Gets a notification config. (notificationConfigs.get)
69   *
70   * @param string $name Required. Name of the notification config to get. Its
71   * format is "organizations/[organization_id]/notificationConfigs/[config_id]".
72   * @param array $optParams Optional parameters.
73   * @return NotificationConfig
74   */
75  public function get($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], NotificationConfig::class);
80  }
81  /**
82   * Lists notification configs.
83   * (notificationConfigs.listOrganizationsNotificationConfigs)
84   *
85   * @param string $parent Required. Name of the organization to list notification
86   * configs. Its format is "organizations/[organization_id]".
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param int pageSize The maximum number of results to return in a single
90   * response. Default is 10, minimum is 1, maximum is 1000.
91   * @opt_param string pageToken The value returned by the last
92   * `ListNotificationConfigsResponse`; indicates that this is a continuation of a
93   * prior `ListNotificationConfigs` call, and that the system should return the
94   * next page of data.
95   * @return ListNotificationConfigsResponse
96   */
97  public function listOrganizationsNotificationConfigs($parent, $optParams = [])
98  {
99    $params = ['parent' => $parent];
100    $params = array_merge($params, $optParams);
101    return $this->call('list', [$params], ListNotificationConfigsResponse::class);
102  }
103  /**
104   * Updates a notification config. The following update fields are allowed:
105   * description, pubsub_topic, streaming_config.filter
106   * (notificationConfigs.patch)
107   *
108   * @param string $name The relative resource name of this notification config.
109   * See:
110   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
111   * Example:
112   * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
113   * @param NotificationConfig $postBody
114   * @param array $optParams Optional parameters.
115   *
116   * @opt_param string updateMask The FieldMask to use when updating the
117   * notification config. If empty all mutable fields will be updated.
118   * @return NotificationConfig
119   */
120  public function patch($name, NotificationConfig $postBody, $optParams = [])
121  {
122    $params = ['name' => $name, 'postBody' => $postBody];
123    $params = array_merge($params, $optParams);
124    return $this->call('patch', [$params], NotificationConfig::class);
125  }
126}
127
128// Adding a class alias for backwards compatibility with the previous class name.
129class_alias(OrganizationsNotificationConfigs::class, 'Google_Service_SecurityCommandCenter_Resource_OrganizationsNotificationConfigs');
130