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\GetIamPolicyRequest;
|
---|
21 | use Google\Service\SecurityCommandCenter\ListSourcesResponse;
|
---|
22 | use Google\Service\SecurityCommandCenter\Policy;
|
---|
23 | use Google\Service\SecurityCommandCenter\SetIamPolicyRequest;
|
---|
24 | use Google\Service\SecurityCommandCenter\Source;
|
---|
25 | use Google\Service\SecurityCommandCenter\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\SecurityCommandCenter\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "sources" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $securitycenterService = new Google\Service\SecurityCommandCenter(...);
|
---|
33 | * $sources = $securitycenterService->organizations_sources;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class OrganizationsSources extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a source. (sources.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. Resource name of the new source's parent. Its
|
---|
42 | * format should be `organizations/[organization_id]`.
|
---|
43 | * @param Source $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return Source
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function create($parent, Source $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('create', [$params], Source::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Gets a source. (sources.get)
|
---|
56 | *
|
---|
57 | * @param string $name Required. Relative resource name of the source. Its
|
---|
58 | * format is `organizations/[organization_id]/source/[source_id]`.
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return Source
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function get($name, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('get', [$params], Source::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Gets the access control policy on the specified Source.
|
---|
71 | * (sources.getIamPolicy)
|
---|
72 | *
|
---|
73 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
74 | * requested. See [Resource
|
---|
75 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
76 | * appropriate value for this field.
|
---|
77 | * @param GetIamPolicyRequest $postBody
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | * @return Policy
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Lists all sources belonging to an organization.
|
---|
90 | * (sources.listOrganizationsSources)
|
---|
91 | *
|
---|
92 | * @param string $parent Required. Resource name of the parent of sources to
|
---|
93 | * list. Its format should be `organizations/[organization_id]`,
|
---|
94 | * `folders/[folder_id]`, or `projects/[project_id]`.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | *
|
---|
97 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
98 | * response. Default is 10, minimum is 1, maximum is 1000.
|
---|
99 | * @opt_param string pageToken The value returned by the last
|
---|
100 | * `ListSourcesResponse`; indicates that this is a continuation of a prior
|
---|
101 | * `ListSources` call, and that the system should return the next page of data.
|
---|
102 | * @return ListSourcesResponse
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function listOrganizationsSources($parent, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['parent' => $parent];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('list', [$params], ListSourcesResponse::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Updates a source. (sources.patch)
|
---|
113 | *
|
---|
114 | * @param string $name The relative resource name of this source. See:
|
---|
115 | * https://cloud.google.com/apis/design/resource_names#relative_resource_name
|
---|
116 | * Example: "organizations/{organization_id}/sources/{source_id}"
|
---|
117 | * @param Source $postBody
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param string updateMask The FieldMask to use when updating the source
|
---|
121 | * resource. If empty all mutable fields will be updated.
|
---|
122 | * @return Source
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function patch($name, Source $postBody, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('patch', [$params], Source::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Sets the access control policy on the specified Source.
|
---|
133 | * (sources.setIamPolicy)
|
---|
134 | *
|
---|
135 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
136 | * specified. See [Resource
|
---|
137 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
138 | * appropriate value for this field.
|
---|
139 | * @param SetIamPolicyRequest $postBody
|
---|
140 | * @param array $optParams Optional parameters.
|
---|
141 | * @return Policy
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
149 | }
|
---|
150 | /**
|
---|
151 | * Returns the permissions that a caller has on the specified source.
|
---|
152 | * (sources.testIamPermissions)
|
---|
153 | *
|
---|
154 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
155 | * being requested. See [Resource
|
---|
156 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
157 | * appropriate value for this field.
|
---|
158 | * @param TestIamPermissionsRequest $postBody
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | * @return TestIamPermissionsResponse
|
---|
161 | * @throws \Google\Service\Exception
|
---|
162 | */
|
---|
163 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
164 | {
|
---|
165 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
166 | $params = array_merge($params, $optParams);
|
---|
167 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
168 | }
|
---|
169 | }
|
---|
170 |
|
---|
171 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
172 | class_alias(OrganizationsSources::class, 'Google_Service_SecurityCommandCenter_Resource_OrganizationsSources');
|
---|