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