[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\SecurityCommandCenter\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\SecurityCommandCenter\EventThreatDetectionCustomModule;
|
---|
| 21 | use Google\Service\SecurityCommandCenter\ListDescendantEventThreatDetectionCustomModulesResponse;
|
---|
| 22 | use Google\Service\SecurityCommandCenter\ListEventThreatDetectionCustomModulesResponse;
|
---|
| 23 | use Google\Service\SecurityCommandCenter\SecuritycenterEmpty;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "customModules" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $securitycenterService = new Google\Service\SecurityCommandCenter(...);
|
---|
| 30 | * $customModules = $securitycenterService->organizations_eventThreatDetectionSettings_customModules;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class OrganizationsEventThreatDetectionSettingsCustomModules extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Creates a resident Event Threat Detection custom module at the scope of the
|
---|
| 37 | * given Resource Manager parent, and also creates inherited custom modules for
|
---|
| 38 | * all descendants of the given parent. These modules are enabled by default.
|
---|
| 39 | * (customModules.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. The new custom module's parent. Its format
|
---|
| 42 | * is: * `organizations/{organization}/eventThreatDetectionSettings`. *
|
---|
| 43 | * `folders/{folder}/eventThreatDetectionSettings`. *
|
---|
| 44 | * `projects/{project}/eventThreatDetectionSettings`.
|
---|
| 45 | * @param EventThreatDetectionCustomModule $postBody
|
---|
| 46 | * @param array $optParams Optional parameters.
|
---|
| 47 | * @return EventThreatDetectionCustomModule
|
---|
| 48 | * @throws \Google\Service\Exception
|
---|
| 49 | */
|
---|
| 50 | public function create($parent, EventThreatDetectionCustomModule $postBody, $optParams = [])
|
---|
| 51 | {
|
---|
| 52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 53 | $params = array_merge($params, $optParams);
|
---|
| 54 | return $this->call('create', [$params], EventThreatDetectionCustomModule::class);
|
---|
| 55 | }
|
---|
| 56 | /**
|
---|
| 57 | * Deletes the specified Event Threat Detection custom module and all of its
|
---|
| 58 | * descendants in the Resource Manager hierarchy. This method is only supported
|
---|
| 59 | * for resident custom modules. (customModules.delete)
|
---|
| 60 | *
|
---|
| 61 | * @param string $name Required. Name of the custom module to delete. Its format
|
---|
| 62 | * is: * `organizations/{organization}/eventThreatDetectionSettings/customModule
|
---|
| 63 | * s/{module}`. *
|
---|
| 64 | * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. *
|
---|
| 65 | * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`.
|
---|
| 66 | * @param array $optParams Optional parameters.
|
---|
| 67 | * @return SecuritycenterEmpty
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function delete($name, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['name' => $name];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('delete', [$params], SecuritycenterEmpty::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Gets an Event Threat Detection custom module. (customModules.get)
|
---|
| 78 | *
|
---|
| 79 | * @param string $name Required. Name of the custom module to get. Its format
|
---|
| 80 | * is: * `organizations/{organization}/eventThreatDetectionSettings/customModule
|
---|
| 81 | * s/{module}`. *
|
---|
| 82 | * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. *
|
---|
| 83 | * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`.
|
---|
| 84 | * @param array $optParams Optional parameters.
|
---|
| 85 | * @return EventThreatDetectionCustomModule
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function get($name, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['name' => $name];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('get', [$params], EventThreatDetectionCustomModule::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Lists all Event Threat Detection custom modules for the given Resource
|
---|
| 96 | * Manager parent. This includes resident modules defined at the scope of the
|
---|
| 97 | * parent along with modules inherited from ancestors.
|
---|
| 98 | * (customModules.listOrganizationsEventThreatDetectionSettingsCustomModules)
|
---|
| 99 | *
|
---|
| 100 | * @param string $parent Required. Name of the parent to list custom modules
|
---|
| 101 | * under. Its format is: *
|
---|
| 102 | * `organizations/{organization}/eventThreatDetectionSettings`. *
|
---|
| 103 | * `folders/{folder}/eventThreatDetectionSettings`. *
|
---|
| 104 | * `projects/{project}/eventThreatDetectionSettings`.
|
---|
| 105 | * @param array $optParams Optional parameters.
|
---|
| 106 | *
|
---|
| 107 | * @opt_param int pageSize The maximum number of modules to return. The service
|
---|
| 108 | * may return fewer than this value. If unspecified, at most 10 configs will be
|
---|
| 109 | * returned. The maximum value is 1000; values above 1000 will be coerced to
|
---|
| 110 | * 1000.
|
---|
| 111 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 112 | * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the
|
---|
| 113 | * subsequent page. When paginating, all other parameters provided to
|
---|
| 114 | * `ListEventThreatDetectionCustomModules` must match the call that provided the
|
---|
| 115 | * page token.
|
---|
| 116 | * @return ListEventThreatDetectionCustomModulesResponse
|
---|
| 117 | * @throws \Google\Service\Exception
|
---|
| 118 | */
|
---|
| 119 | public function listOrganizationsEventThreatDetectionSettingsCustomModules($parent, $optParams = [])
|
---|
| 120 | {
|
---|
| 121 | $params = ['parent' => $parent];
|
---|
| 122 | $params = array_merge($params, $optParams);
|
---|
| 123 | return $this->call('list', [$params], ListEventThreatDetectionCustomModulesResponse::class);
|
---|
| 124 | }
|
---|
| 125 | /**
|
---|
| 126 | * Lists all resident Event Threat Detection custom modules under the given
|
---|
| 127 | * Resource Manager parent and its descendants. (customModules.listDescendant)
|
---|
| 128 | *
|
---|
| 129 | * @param string $parent Required. Name of the parent to list custom modules
|
---|
| 130 | * under. Its format is: *
|
---|
| 131 | * `organizations/{organization}/eventThreatDetectionSettings`. *
|
---|
| 132 | * `folders/{folder}/eventThreatDetectionSettings`. *
|
---|
| 133 | * `projects/{project}/eventThreatDetectionSettings`.
|
---|
| 134 | * @param array $optParams Optional parameters.
|
---|
| 135 | *
|
---|
| 136 | * @opt_param int pageSize The maximum number of modules to return. The service
|
---|
| 137 | * may return fewer than this value. If unspecified, at most 10 configs will be
|
---|
| 138 | * returned. The maximum value is 1000; values above 1000 will be coerced to
|
---|
| 139 | * 1000.
|
---|
| 140 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 141 | * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to
|
---|
| 142 | * retrieve the subsequent page. When paginating, all other parameters provided
|
---|
| 143 | * to `ListDescendantEventThreatDetectionCustomModules` must match the call that
|
---|
| 144 | * provided the page token.
|
---|
| 145 | * @return ListDescendantEventThreatDetectionCustomModulesResponse
|
---|
| 146 | * @throws \Google\Service\Exception
|
---|
| 147 | */
|
---|
| 148 | public function listDescendant($parent, $optParams = [])
|
---|
| 149 | {
|
---|
| 150 | $params = ['parent' => $parent];
|
---|
| 151 | $params = array_merge($params, $optParams);
|
---|
| 152 | return $this->call('listDescendant', [$params], ListDescendantEventThreatDetectionCustomModulesResponse::class);
|
---|
| 153 | }
|
---|
| 154 | /**
|
---|
| 155 | * Updates the Event Threat Detection custom module with the given name based on
|
---|
| 156 | * the given update mask. Updating the enablement state is supported for both
|
---|
| 157 | * resident and inherited modules (though resident modules cannot have an
|
---|
| 158 | * enablement state of "inherited"). Updating the display name or configuration
|
---|
| 159 | * of a module is supported for resident modules only. The type of a module
|
---|
| 160 | * cannot be changed. (customModules.patch)
|
---|
| 161 | *
|
---|
| 162 | * @param string $name Immutable. The resource name of the Event Threat
|
---|
| 163 | * Detection custom module. Its format is: * `organizations/{organization}/event
|
---|
| 164 | * ThreatDetectionSettings/customModules/{module}`. *
|
---|
| 165 | * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. *
|
---|
| 166 | * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`.
|
---|
| 167 | * @param EventThreatDetectionCustomModule $postBody
|
---|
| 168 | * @param array $optParams Optional parameters.
|
---|
| 169 | *
|
---|
| 170 | * @opt_param string updateMask The list of fields to be updated. If empty all
|
---|
| 171 | * mutable fields will be updated.
|
---|
| 172 | * @return EventThreatDetectionCustomModule
|
---|
| 173 | * @throws \Google\Service\Exception
|
---|
| 174 | */
|
---|
| 175 | public function patch($name, EventThreatDetectionCustomModule $postBody, $optParams = [])
|
---|
| 176 | {
|
---|
| 177 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 178 | $params = array_merge($params, $optParams);
|
---|
| 179 | return $this->call('patch', [$params], EventThreatDetectionCustomModule::class);
|
---|
| 180 | }
|
---|
| 181 | }
|
---|
| 182 |
|
---|
| 183 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 184 | class_alias(OrganizationsEventThreatDetectionSettingsCustomModules::class, 'Google_Service_SecurityCommandCenter_Resource_OrganizationsEventThreatDetectionSettingsCustomModules');
|
---|