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\GoogleCloudSecuritycenterV1MuteConfig;
21use Google\Service\SecurityCommandCenter\ListMuteConfigsResponse;
22use Google\Service\SecurityCommandCenter\SecuritycenterEmpty;
23
24/**
25 * The "muteConfigs" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $securitycenterService = new Google\Service\SecurityCommandCenter(...);
29 *   $muteConfigs = $securitycenterService->muteConfigs;
30 *  </code>
31 */
32class ProjectsMuteConfigs extends \Google\Service\Resource
33{
34  /**
35   * Creates a mute config. (muteConfigs.create)
36   *
37   * @param string $parent Required. Resource name of the new mute configs's
38   * parent. Its format is "organizations/[organization_id]",
39   * "folders/[folder_id]", or "projects/[project_id]".
40   * @param GoogleCloudSecuritycenterV1MuteConfig $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string muteConfigId Required. Unique identifier provided by the
44   * client within the parent scope. It must consist of lower case letters,
45   * numbers, and hyphen, with the first character a letter, the last a letter or
46   * a number, and a 63 character maximum.
47   * @return GoogleCloudSecuritycenterV1MuteConfig
48   */
49  public function create($parent, GoogleCloudSecuritycenterV1MuteConfig $postBody, $optParams = [])
50  {
51    $params = ['parent' => $parent, 'postBody' => $postBody];
52    $params = array_merge($params, $optParams);
53    return $this->call('create', [$params], GoogleCloudSecuritycenterV1MuteConfig::class);
54  }
55  /**
56   * Deletes an existing mute config. (muteConfigs.delete)
57   *
58   * @param string $name Required. Name of the mute config to delete. Its format
59   * is organizations/{organization}/muteConfigs/{config_id},
60   * folders/{folder}/muteConfigs/{config_id}, or
61   * projects/{project}/muteConfigs/{config_id}
62   * @param array $optParams Optional parameters.
63   * @return SecuritycenterEmpty
64   */
65  public function delete($name, $optParams = [])
66  {
67    $params = ['name' => $name];
68    $params = array_merge($params, $optParams);
69    return $this->call('delete', [$params], SecuritycenterEmpty::class);
70  }
71  /**
72   * Gets a mute config. (muteConfigs.get)
73   *
74   * @param string $name Required. Name of the mute config to retrieve. Its format
75   * is organizations/{organization}/muteConfigs/{config_id},
76   * folders/{folder}/muteConfigs/{config_id}, or
77   * projects/{project}/muteConfigs/{config_id}
78   * @param array $optParams Optional parameters.
79   * @return GoogleCloudSecuritycenterV1MuteConfig
80   */
81  public function get($name, $optParams = [])
82  {
83    $params = ['name' => $name];
84    $params = array_merge($params, $optParams);
85    return $this->call('get', [$params], GoogleCloudSecuritycenterV1MuteConfig::class);
86  }
87  /**
88   * Lists mute configs. (muteConfigs.listProjectsMuteConfigs)
89   *
90   * @param string $parent Required. The parent, which owns the collection of mute
91   * configs. Its format is "organizations/[organization_id]",
92   * "folders/[folder_id]", "projects/[project_id]".
93   * @param array $optParams Optional parameters.
94   *
95   * @opt_param int pageSize The maximum number of configs to return. The service
96   * may return fewer than this value. If unspecified, at most 10 configs will be
97   * returned. The maximum value is 1000; values above 1000 will be coerced to
98   * 1000.
99   * @opt_param string pageToken A page token, received from a previous
100   * `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When
101   * paginating, all other parameters provided to `ListMuteConfigs` must match the
102   * call that provided the page token.
103   * @return ListMuteConfigsResponse
104   */
105  public function listProjectsMuteConfigs($parent, $optParams = [])
106  {
107    $params = ['parent' => $parent];
108    $params = array_merge($params, $optParams);
109    return $this->call('list', [$params], ListMuteConfigsResponse::class);
110  }
111  /**
112   * Updates a mute config. (muteConfigs.patch)
113   *
114   * @param string $name This field will be ignored if provided on config
115   * creation. Format "organizations/{organization}/muteConfigs/{mute_config}"
116   * "folders/{folder}/muteConfigs/{mute_config}"
117   * "projects/{project}/muteConfigs/{mute_config}"
118   * @param GoogleCloudSecuritycenterV1MuteConfig $postBody
119   * @param array $optParams Optional parameters.
120   *
121   * @opt_param string updateMask The list of fields to be updated. If empty all
122   * mutable fields will be updated.
123   * @return GoogleCloudSecuritycenterV1MuteConfig
124   */
125  public function patch($name, GoogleCloudSecuritycenterV1MuteConfig $postBody, $optParams = [])
126  {
127    $params = ['name' => $name, 'postBody' => $postBody];
128    $params = array_merge($params, $optParams);
129    return $this->call('patch', [$params], GoogleCloudSecuritycenterV1MuteConfig::class);
130  }
131}
132
133// Adding a class alias for backwards compatibility with the previous class name.
134class_alias(ProjectsMuteConfigs::class, 'Google_Service_SecurityCommandCenter_Resource_ProjectsMuteConfigs');
135