source: vendor/google/apiclient-services/src/SecurityCommandCenter/Resource/OrganizationsAssets.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 10.6 KB
Line 
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\GroupAssetsRequest;
21use Google\Service\SecurityCommandCenter\GroupAssetsResponse;
22use Google\Service\SecurityCommandCenter\ListAssetsResponse;
23use Google\Service\SecurityCommandCenter\Operation;
24use Google\Service\SecurityCommandCenter\RunAssetDiscoveryRequest;
25use Google\Service\SecurityCommandCenter\SecurityMarks;
26
27/**
28 * The "assets" collection of methods.
29 * Typical usage is:
30 * <code>
31 * $securitycenterService = new Google\Service\SecurityCommandCenter(...);
32 * $assets = $securitycenterService->organizations_assets;
33 * </code>
34 */
35class OrganizationsAssets extends \Google\Service\Resource
36{
37 /**
38 * Filters an organization's assets and groups them by their specified
39 * properties. (assets.group)
40 *
41 * @param string $parent Required. The name of the parent to group the assets
42 * by. Its format is `organizations/[organization_id]`, `folders/[folder_id]`,
43 * or `projects/[project_id]`.
44 * @param GroupAssetsRequest $postBody
45 * @param array $optParams Optional parameters.
46 * @return GroupAssetsResponse
47 * @throws \Google\Service\Exception
48 */
49 public function group($parent, GroupAssetsRequest $postBody, $optParams = [])
50 {
51 $params = ['parent' => $parent, 'postBody' => $postBody];
52 $params = array_merge($params, $optParams);
53 return $this->call('group', [$params], GroupAssetsResponse::class);
54 }
55 /**
56 * Lists an organization's assets. (assets.listOrganizationsAssets)
57 *
58 * @param string $parent Required. The name of the parent resource that contains
59 * the assets. The value that you can specify on parent depends on the method in
60 * which you specify parent. You can specify one of the following values:
61 * `organizations/[organization_id]`, `folders/[folder_id]`, or
62 * `projects/[project_id]`.
63 * @param array $optParams Optional parameters.
64 *
65 * @opt_param string compareDuration When compare_duration is set, the
66 * ListAssetsResult's "state_change" attribute is updated to indicate whether
67 * the asset was added, removed, or remained present during the compare_duration
68 * period of time that precedes the read_time. This is the time between
69 * (read_time - compare_duration) and read_time. The state_change value is
70 * derived based on the presence of the asset at the two points in time.
71 * Intermediate state changes between the two times don't affect the result. For
72 * example, the results aren't affected if the asset is removed and re-created
73 * again. Possible "state_change" values when compare_duration is specified: *
74 * "ADDED": indicates that the asset was not present at the start of
75 * compare_duration, but present at read_time. * "REMOVED": indicates that the
76 * asset was present at the start of compare_duration, but not present at
77 * read_time. * "ACTIVE": indicates that the asset was present at both the start
78 * and the end of the time period defined by compare_duration and read_time. If
79 * compare_duration is not specified, then the only possible state_change is
80 * "UNUSED", which will be the state_change set for all assets present at
81 * read_time.
82 * @opt_param string fieldMask A field mask to specify the ListAssetsResult
83 * fields to be listed in the response. An empty field mask will list all
84 * fields.
85 * @opt_param string filter Expression that defines the filter to apply across
86 * assets. The expression is a list of zero or more restrictions combined via
87 * logical operators `AND` and `OR`. Parentheses are supported, and `OR` has
88 * higher precedence than `AND`. Restrictions have the form ` ` and may have a
89 * `-` character in front of them to indicate negation. The fields map to those
90 * defined in the Asset resource. Examples include: * name *
91 * security_center_properties.resource_name * resource_properties.a_property *
92 * security_marks.marks.marka The supported operators are: * `=` for all value
93 * types. * `>`, `<`, `>=`, `<=` for integer values. * `:`, meaning substring
94 * matching, for strings. The supported value types are: * string literals in
95 * quotes. * integer literals without quotes. * boolean literals `true` and
96 * `false` without quotes. The following are the allowed field and operator
97 * combinations: * name: `=` * update_time: `=`, `>`, `<`, `>=`, `<=` Usage:
98 * This should be milliseconds since epoch or an RFC3339 string. Examples:
99 * `update_time = "2019-06-10T16:07:18-07:00"` `update_time = 1560208038000` *
100 * create_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be milliseconds
101 * since epoch or an RFC3339 string. Examples: `create_time =
102 * "2019-06-10T16:07:18-07:00"` `create_time = 1560208038000` *
103 * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `>`, `<`,
104 * `>=`, `<=` * security_marks.marks: `=`, `:` *
105 * security_center_properties.resource_name: `=`, `:` *
106 * security_center_properties.resource_display_name: `=`, `:` *
107 * security_center_properties.resource_type: `=`, `:` *
108 * security_center_properties.resource_parent: `=`, `:` *
109 * security_center_properties.resource_parent_display_name: `=`, `:` *
110 * security_center_properties.resource_project: `=`, `:` *
111 * security_center_properties.resource_project_display_name: `=`, `:` *
112 * security_center_properties.resource_owners: `=`, `:` For example,
113 * `resource_properties.size = 100` is a valid filter string. Use a partial
114 * match on the empty string to filter based on a property existing:
115 * `resource_properties.my_property : ""` Use a negated partial match on the
116 * empty string to filter based on a property not existing:
117 * `-resource_properties.my_property : ""`
118 * @opt_param string orderBy Expression that defines what fields and order to
119 * use for sorting. The string value should follow SQL syntax: comma separated
120 * list of fields. For example: "name,resource_properties.a_property". The
121 * default sorting order is ascending. To specify descending order for a field,
122 * a suffix " desc" should be appended to the field name. For example: "name
123 * desc,resource_properties.a_property". Redundant space characters in the
124 * syntax are insignificant. "name desc,resource_properties.a_property" and "
125 * name desc , resource_properties.a_property " are equivalent. The following
126 * fields are supported: name update_time resource_properties
127 * security_marks.marks security_center_properties.resource_name
128 * security_center_properties.resource_display_name
129 * security_center_properties.resource_parent
130 * security_center_properties.resource_parent_display_name
131 * security_center_properties.resource_project
132 * security_center_properties.resource_project_display_name
133 * security_center_properties.resource_type
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
137 * `ListAssetsResponse`; indicates that this is a continuation of a prior
138 * `ListAssets` call, and that the system should return the next page of data.
139 * @opt_param string readTime Time used as a reference point when filtering
140 * assets. The filter is limited to assets existing at the supplied time and
141 * their values are those at that specific time. Absence of this field will
142 * default to the API's version of NOW.
143 * @return ListAssetsResponse
144 * @throws \Google\Service\Exception
145 */
146 public function listOrganizationsAssets($parent, $optParams = [])
147 {
148 $params = ['parent' => $parent];
149 $params = array_merge($params, $optParams);
150 return $this->call('list', [$params], ListAssetsResponse::class);
151 }
152 /**
153 * Runs asset discovery. The discovery is tracked with a long-running operation.
154 * This API can only be called with limited frequency for an organization. If it
155 * is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
156 * (assets.runDiscovery)
157 *
158 * @param string $parent Required. Name of the organization to run asset
159 * discovery for. Its format is `organizations/[organization_id]`.
160 * @param RunAssetDiscoveryRequest $postBody
161 * @param array $optParams Optional parameters.
162 * @return Operation
163 * @throws \Google\Service\Exception
164 */
165 public function runDiscovery($parent, RunAssetDiscoveryRequest $postBody, $optParams = [])
166 {
167 $params = ['parent' => $parent, 'postBody' => $postBody];
168 $params = array_merge($params, $optParams);
169 return $this->call('runDiscovery', [$params], Operation::class);
170 }
171 /**
172 * Updates security marks. (assets.updateSecurityMarks)
173 *
174 * @param string $name The relative resource name of the SecurityMarks. See:
175 * https://cloud.google.com/apis/design/resource_names#relative_resource_name
176 * Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks" "
177 * organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/sec
178 * urityMarks".
179 * @param SecurityMarks $postBody
180 * @param array $optParams Optional parameters.
181 *
182 * @opt_param string startTime The time at which the updated SecurityMarks take
183 * effect. If not set uses current server time. Updates will be applied to the
184 * SecurityMarks that are active immediately preceding this time. Must be
185 * earlier or equal to the server time.
186 * @opt_param string updateMask The FieldMask to use when updating the security
187 * marks resource. The field mask must not contain duplicate fields. If empty or
188 * set to "marks", all marks will be replaced. Individual marks can be updated
189 * using "marks.".
190 * @return SecurityMarks
191 * @throws \Google\Service\Exception
192 */
193 public function updateSecurityMarks($name, SecurityMarks $postBody, $optParams = [])
194 {
195 $params = ['name' => $name, 'postBody' => $postBody];
196 $params = array_merge($params, $optParams);
197 return $this->call('updateSecurityMarks', [$params], SecurityMarks::class);
198 }
199}
200
201// Adding a class alias for backwards compatibility with the previous class name.
202class_alias(OrganizationsAssets::class, 'Google_Service_SecurityCommandCenter_Resource_OrganizationsAssets');
Note: See TracBrowser for help on using the repository browser.