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\ContainerAnalysis\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ContainerAnalysis\BatchCreateNotesRequest;
|
---|
21 | use Google\Service\ContainerAnalysis\BatchCreateNotesResponse;
|
---|
22 | use Google\Service\ContainerAnalysis\ContaineranalysisEmpty;
|
---|
23 | use Google\Service\ContainerAnalysis\GetIamPolicyRequest;
|
---|
24 | use Google\Service\ContainerAnalysis\ListNotesResponse;
|
---|
25 | use Google\Service\ContainerAnalysis\Note;
|
---|
26 | use Google\Service\ContainerAnalysis\Policy;
|
---|
27 | use Google\Service\ContainerAnalysis\SetIamPolicyRequest;
|
---|
28 | use Google\Service\ContainerAnalysis\TestIamPermissionsRequest;
|
---|
29 | use Google\Service\ContainerAnalysis\TestIamPermissionsResponse;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "notes" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $containeranalysisService = new Google\Service\ContainerAnalysis(...);
|
---|
36 | * $notes = $containeranalysisService->projects_notes;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsNotes extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Creates new notes in batch. (notes.batchCreate)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. The name of the project in the form of
|
---|
45 | * `projects/[PROJECT_ID]`, under which the notes are to be created.
|
---|
46 | * @param BatchCreateNotesRequest $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | * @return BatchCreateNotesResponse
|
---|
49 | * @throws \Google\Service\Exception
|
---|
50 | */
|
---|
51 | public function batchCreate($parent, BatchCreateNotesRequest $postBody, $optParams = [])
|
---|
52 | {
|
---|
53 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
54 | $params = array_merge($params, $optParams);
|
---|
55 | return $this->call('batchCreate', [$params], BatchCreateNotesResponse::class);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Creates a new note. (notes.create)
|
---|
59 | *
|
---|
60 | * @param string $parent Required. The name of the project in the form of
|
---|
61 | * `projects/[PROJECT_ID]`, under which the note is to be created.
|
---|
62 | * @param Note $postBody
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | *
|
---|
65 | * @opt_param string noteId Required. The ID to use for this note.
|
---|
66 | * @return Note
|
---|
67 | * @throws \Google\Service\Exception
|
---|
68 | */
|
---|
69 | public function create($parent, Note $postBody, $optParams = [])
|
---|
70 | {
|
---|
71 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
72 | $params = array_merge($params, $optParams);
|
---|
73 | return $this->call('create', [$params], Note::class);
|
---|
74 | }
|
---|
75 | /**
|
---|
76 | * Deletes the specified note. (notes.delete)
|
---|
77 | *
|
---|
78 | * @param string $name Required. The name of the note in the form of
|
---|
79 | * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | * @return ContaineranalysisEmpty
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function delete($name, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('delete', [$params], ContaineranalysisEmpty::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Gets the specified note. (notes.get)
|
---|
92 | *
|
---|
93 | * @param string $name Required. The name of the note in the form of
|
---|
94 | * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | * @return Note
|
---|
97 | * @throws \Google\Service\Exception
|
---|
98 | */
|
---|
99 | public function get($name, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['name' => $name];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('get', [$params], Note::class);
|
---|
104 | }
|
---|
105 | /**
|
---|
106 | * Gets the access control policy for a note or an occurrence resource. Requires
|
---|
107 | * `containeranalysis.notes.setIamPolicy` or
|
---|
108 | * `containeranalysis.occurrences.setIamPolicy` permission if the resource is a
|
---|
109 | * note or occurrence, respectively. The resource takes the format
|
---|
110 | * `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
|
---|
111 | * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
|
---|
112 | * (notes.getIamPolicy)
|
---|
113 | *
|
---|
114 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
115 | * requested. See [Resource
|
---|
116 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
117 | * appropriate value for this field.
|
---|
118 | * @param GetIamPolicyRequest $postBody
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | * @return Policy
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Lists notes for the specified project. (notes.listProjectsNotes)
|
---|
131 | *
|
---|
132 | * @param string $parent Required. The name of the project to list notes for in
|
---|
133 | * the form of `projects/[PROJECT_ID]`.
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | *
|
---|
136 | * @opt_param string filter The filter expression.
|
---|
137 | * @opt_param int pageSize Number of notes to return in the list. Must be
|
---|
138 | * positive. Max allowed page size is 1000. If not specified, page size defaults
|
---|
139 | * to 20.
|
---|
140 | * @opt_param string pageToken Token to provide to skip to a particular spot in
|
---|
141 | * the list.
|
---|
142 | * @return ListNotesResponse
|
---|
143 | * @throws \Google\Service\Exception
|
---|
144 | */
|
---|
145 | public function listProjectsNotes($parent, $optParams = [])
|
---|
146 | {
|
---|
147 | $params = ['parent' => $parent];
|
---|
148 | $params = array_merge($params, $optParams);
|
---|
149 | return $this->call('list', [$params], ListNotesResponse::class);
|
---|
150 | }
|
---|
151 | /**
|
---|
152 | * Updates the specified note. (notes.patch)
|
---|
153 | *
|
---|
154 | * @param string $name Required. The name of the note in the form of
|
---|
155 | * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
|
---|
156 | * @param Note $postBody
|
---|
157 | * @param array $optParams Optional parameters.
|
---|
158 | *
|
---|
159 | * @opt_param string updateMask The fields to update.
|
---|
160 | * @return Note
|
---|
161 | * @throws \Google\Service\Exception
|
---|
162 | */
|
---|
163 | public function patch($name, Note $postBody, $optParams = [])
|
---|
164 | {
|
---|
165 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
166 | $params = array_merge($params, $optParams);
|
---|
167 | return $this->call('patch', [$params], Note::class);
|
---|
168 | }
|
---|
169 | /**
|
---|
170 | * Sets the access control policy on the specified note or occurrence. Requires
|
---|
171 | * `containeranalysis.notes.setIamPolicy` or
|
---|
172 | * `containeranalysis.occurrences.setIamPolicy` permission if the resource is a
|
---|
173 | * note or an occurrence, respectively. The resource takes the format
|
---|
174 | * `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
|
---|
175 | * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
|
---|
176 | * (notes.setIamPolicy)
|
---|
177 | *
|
---|
178 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
179 | * specified. See [Resource
|
---|
180 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
181 | * appropriate value for this field.
|
---|
182 | * @param SetIamPolicyRequest $postBody
|
---|
183 | * @param array $optParams Optional parameters.
|
---|
184 | * @return Policy
|
---|
185 | * @throws \Google\Service\Exception
|
---|
186 | */
|
---|
187 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
188 | {
|
---|
189 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
190 | $params = array_merge($params, $optParams);
|
---|
191 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
192 | }
|
---|
193 | /**
|
---|
194 | * Returns the permissions that a caller has on the specified note or
|
---|
195 | * occurrence. Requires list permission on the project (for example,
|
---|
196 | * `containeranalysis.notes.list`). The resource takes the format
|
---|
197 | * `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
|
---|
198 | * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.
|
---|
199 | * (notes.testIamPermissions)
|
---|
200 | *
|
---|
201 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
202 | * being requested. See [Resource
|
---|
203 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
204 | * appropriate value for this field.
|
---|
205 | * @param TestIamPermissionsRequest $postBody
|
---|
206 | * @param array $optParams Optional parameters.
|
---|
207 | * @return TestIamPermissionsResponse
|
---|
208 | * @throws \Google\Service\Exception
|
---|
209 | */
|
---|
210 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
211 | {
|
---|
212 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
213 | $params = array_merge($params, $optParams);
|
---|
214 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
215 | }
|
---|
216 | }
|
---|
217 |
|
---|
218 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
219 | class_alias(ProjectsNotes::class, 'Google_Service_ContainerAnalysis_Resource_ProjectsNotes');
|
---|