[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\GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule;
|
---|
| 21 | use Google\Service\SecurityCommandCenter\ListDescendantSecurityHealthAnalyticsCustomModulesResponse;
|
---|
| 22 | use Google\Service\SecurityCommandCenter\ListSecurityHealthAnalyticsCustomModulesResponse;
|
---|
| 23 | use Google\Service\SecurityCommandCenter\SecuritycenterEmpty;
|
---|
| 24 | use Google\Service\SecurityCommandCenter\SimulateSecurityHealthAnalyticsCustomModuleRequest;
|
---|
| 25 | use Google\Service\SecurityCommandCenter\SimulateSecurityHealthAnalyticsCustomModuleResponse;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "customModules" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $securitycenterService = new Google\Service\SecurityCommandCenter(...);
|
---|
| 32 | * $customModules = $securitycenterService->projects_securityHealthAnalyticsSettings_customModules;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class ProjectsSecurityHealthAnalyticsSettingsCustomModules extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the
|
---|
| 39 | * given CRM parent, and also creates inherited
|
---|
| 40 | * SecurityHealthAnalyticsCustomModules for all CRM descendants of the given
|
---|
| 41 | * parent. These modules are enabled by default. (customModules.create)
|
---|
| 42 | *
|
---|
| 43 | * @param string $parent Required. Resource name of the new custom module's
|
---|
| 44 | * parent. Its format is
|
---|
| 45 | * `organizations/{organization}/securityHealthAnalyticsSettings`,
|
---|
| 46 | * `folders/{folder}/securityHealthAnalyticsSettings`, or
|
---|
| 47 | * `projects/{project}/securityHealthAnalyticsSettings`
|
---|
| 48 | * @param GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function create($parent, GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('create', [$params], GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Deletes the specified SecurityHealthAnalyticsCustomModule and all of its
|
---|
| 61 | * descendants in the CRM hierarchy. This method is only supported for resident
|
---|
| 62 | * custom modules. (customModules.delete)
|
---|
| 63 | *
|
---|
| 64 | * @param string $name Required. Name of the custom module to delete. Its format
|
---|
| 65 | * is `organizations/{organization}/securityHealthAnalyticsSettings/customModule
|
---|
| 66 | * s/{customModule}`, `folders/{folder}/securityHealthAnalyticsSettings/customMo
|
---|
| 67 | * dules/{customModule}`, or `projects/{project}/securityHealthAnalyticsSettings
|
---|
| 68 | * /customModules/{customModule}`
|
---|
| 69 | * @param array $optParams Optional parameters.
|
---|
| 70 | * @return SecuritycenterEmpty
|
---|
| 71 | * @throws \Google\Service\Exception
|
---|
| 72 | */
|
---|
| 73 | public function delete($name, $optParams = [])
|
---|
| 74 | {
|
---|
| 75 | $params = ['name' => $name];
|
---|
| 76 | $params = array_merge($params, $optParams);
|
---|
| 77 | return $this->call('delete', [$params], SecuritycenterEmpty::class);
|
---|
| 78 | }
|
---|
| 79 | /**
|
---|
| 80 | * Retrieves a SecurityHealthAnalyticsCustomModule. (customModules.get)
|
---|
| 81 | *
|
---|
| 82 | * @param string $name Required. Name of the custom module to get. Its format is
|
---|
| 83 | * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{
|
---|
| 84 | * customModule}`, `folders/{folder}/securityHealthAnalyticsSettings/customModul
|
---|
| 85 | * es/{customModule}`, or `projects/{project}/securityHealthAnalyticsSettings/cu
|
---|
| 86 | * stomModules/{customModule}`
|
---|
| 87 | * @param array $optParams Optional parameters.
|
---|
| 88 | * @return GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function get($name, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['name' => $name];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('get', [$params], GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Returns a list of all SecurityHealthAnalyticsCustomModules for the given
|
---|
| 99 | * parent. This includes resident modules defined at the scope of the parent,
|
---|
| 100 | * and inherited modules, inherited from CRM ancestors.
|
---|
| 101 | * (customModules.listProjectsSecurityHealthAnalyticsSettingsCustomModules)
|
---|
| 102 | *
|
---|
| 103 | * @param string $parent Required. Name of parent to list custom modules. Its
|
---|
| 104 | * format is `organizations/{organization}/securityHealthAnalyticsSettings`,
|
---|
| 105 | * `folders/{folder}/securityHealthAnalyticsSettings`, or
|
---|
| 106 | * `projects/{project}/securityHealthAnalyticsSettings`
|
---|
| 107 | * @param array $optParams Optional parameters.
|
---|
| 108 | *
|
---|
| 109 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
| 110 | * response. Default is 10, minimum is 1, maximum is 1000.
|
---|
| 111 | * @opt_param string pageToken The value returned by the last call indicating a
|
---|
| 112 | * continuation
|
---|
| 113 | * @return ListSecurityHealthAnalyticsCustomModulesResponse
|
---|
| 114 | * @throws \Google\Service\Exception
|
---|
| 115 | */
|
---|
| 116 | public function listProjectsSecurityHealthAnalyticsSettingsCustomModules($parent, $optParams = [])
|
---|
| 117 | {
|
---|
| 118 | $params = ['parent' => $parent];
|
---|
| 119 | $params = array_merge($params, $optParams);
|
---|
| 120 | return $this->call('list', [$params], ListSecurityHealthAnalyticsCustomModulesResponse::class);
|
---|
| 121 | }
|
---|
| 122 | /**
|
---|
| 123 | * Returns a list of all resident SecurityHealthAnalyticsCustomModules under the
|
---|
| 124 | * given CRM parent and all of the parent’s CRM descendants.
|
---|
| 125 | * (customModules.listDescendant)
|
---|
| 126 | *
|
---|
| 127 | * @param string $parent Required. Name of parent to list descendant custom
|
---|
| 128 | * modules. Its format is
|
---|
| 129 | * `organizations/{organization}/securityHealthAnalyticsSettings`,
|
---|
| 130 | * `folders/{folder}/securityHealthAnalyticsSettings`, or
|
---|
| 131 | * `projects/{project}/securityHealthAnalyticsSettings`
|
---|
| 132 | * @param array $optParams Optional parameters.
|
---|
| 133 | *
|
---|
| 134 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
| 135 | * response. Default is 10, minimum is 1, maximum is 1000.
|
---|
| 136 | * @opt_param string pageToken The value returned by the last call indicating a
|
---|
| 137 | * continuation
|
---|
| 138 | * @return ListDescendantSecurityHealthAnalyticsCustomModulesResponse
|
---|
| 139 | * @throws \Google\Service\Exception
|
---|
| 140 | */
|
---|
| 141 | public function listDescendant($parent, $optParams = [])
|
---|
| 142 | {
|
---|
| 143 | $params = ['parent' => $parent];
|
---|
| 144 | $params = array_merge($params, $optParams);
|
---|
| 145 | return $this->call('listDescendant', [$params], ListDescendantSecurityHealthAnalyticsCustomModulesResponse::class);
|
---|
| 146 | }
|
---|
| 147 | /**
|
---|
| 148 | * Updates the SecurityHealthAnalyticsCustomModule under the given name based on
|
---|
| 149 | * the given update mask. Updating the enablement state is supported on both
|
---|
| 150 | * resident and inherited modules (though resident modules cannot have an
|
---|
| 151 | * enablement state of "inherited"). Updating the display name and custom config
|
---|
| 152 | * of a module is supported on resident modules only. (customModules.patch)
|
---|
| 153 | *
|
---|
| 154 | * @param string $name Immutable. The resource name of the custom module. Its
|
---|
| 155 | * format is "organizations/{organization}/securityHealthAnalyticsSettings/custo
|
---|
| 156 | * mModules/{customModule}", or "folders/{folder}/securityHealthAnalyticsSetting
|
---|
| 157 | * s/customModules/{customModule}", or "projects/{project}/securityHealthAnalyti
|
---|
| 158 | * csSettings/customModules/{customModule}" The id {customModule} is server-
|
---|
| 159 | * generated and is not user settable. It will be a numeric id containing 1-20
|
---|
| 160 | * digits.
|
---|
| 161 | * @param GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule $postBody
|
---|
| 162 | * @param array $optParams Optional parameters.
|
---|
| 163 | *
|
---|
| 164 | * @opt_param string updateMask The list of fields to be updated. The only
|
---|
| 165 | * fields that can be updated are `enablement_state` and `custom_config`. If
|
---|
| 166 | * empty or set to the wildcard value `*`, both `enablement_state` and
|
---|
| 167 | * `custom_config` are updated.
|
---|
| 168 | * @return GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule
|
---|
| 169 | * @throws \Google\Service\Exception
|
---|
| 170 | */
|
---|
| 171 | public function patch($name, GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule $postBody, $optParams = [])
|
---|
| 172 | {
|
---|
| 173 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 174 | $params = array_merge($params, $optParams);
|
---|
| 175 | return $this->call('patch', [$params], GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule::class);
|
---|
| 176 | }
|
---|
| 177 | /**
|
---|
| 178 | * Simulates a given SecurityHealthAnalyticsCustomModule and Resource.
|
---|
| 179 | * (customModules.simulate)
|
---|
| 180 | *
|
---|
| 181 | * @param string $parent Required. The relative resource name of the
|
---|
| 182 | * organization, project, or folder. For more information about relative
|
---|
| 183 | * resource names, see [Relative Resource Name](https://cloud.google.com/apis/de
|
---|
| 184 | * sign/resource_names#relative_resource_name) Example:
|
---|
| 185 | * `organizations/{organization_id}`
|
---|
| 186 | * @param SimulateSecurityHealthAnalyticsCustomModuleRequest $postBody
|
---|
| 187 | * @param array $optParams Optional parameters.
|
---|
| 188 | * @return SimulateSecurityHealthAnalyticsCustomModuleResponse
|
---|
| 189 | * @throws \Google\Service\Exception
|
---|
| 190 | */
|
---|
| 191 | public function simulate($parent, SimulateSecurityHealthAnalyticsCustomModuleRequest $postBody, $optParams = [])
|
---|
| 192 | {
|
---|
| 193 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 194 | $params = array_merge($params, $optParams);
|
---|
| 195 | return $this->call('simulate', [$params], SimulateSecurityHealthAnalyticsCustomModuleResponse::class);
|
---|
| 196 | }
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 200 | class_alias(ProjectsSecurityHealthAnalyticsSettingsCustomModules::class, 'Google_Service_SecurityCommandCenter_Resource_ProjectsSecurityHealthAnalyticsSettingsCustomModules');
|
---|