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\Logging\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Logging\GetIamPolicyRequest;
|
---|
21 | use Google\Service\Logging\ListViewsResponse;
|
---|
22 | use Google\Service\Logging\LogView;
|
---|
23 | use Google\Service\Logging\LoggingEmpty;
|
---|
24 | use Google\Service\Logging\Policy;
|
---|
25 | use Google\Service\Logging\SetIamPolicyRequest;
|
---|
26 | use Google\Service\Logging\TestIamPermissionsRequest;
|
---|
27 | use Google\Service\Logging\TestIamPermissionsResponse;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "views" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $loggingService = new Google\Service\Logging(...);
|
---|
34 | * $views = $loggingService->locations_buckets_views;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class LocationsBucketsViews extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates a view over log entries in a log bucket. A bucket may contain a
|
---|
41 | * maximum of 30 views. (views.create)
|
---|
42 | *
|
---|
43 | * @param string $parent Required. The bucket in which to create the view
|
---|
44 | * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` For
|
---|
45 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
46 | * @param LogView $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | *
|
---|
49 | * @opt_param string viewId Required. A client-assigned identifier such as "my-
|
---|
50 | * view". Identifiers are limited to 100 characters and can include only
|
---|
51 | * letters, digits, underscores, hyphens, and periods.
|
---|
52 | * @return LogView
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function create($parent, LogView $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('create', [$params], LogView::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this
|
---|
63 | * indicates that system is not in a state where it can delete the view. If this
|
---|
64 | * occurs, please try again in a few minutes. (views.delete)
|
---|
65 | *
|
---|
66 | * @param string $name Required. The full resource name of the view to delete: "
|
---|
67 | * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW
|
---|
68 | * _ID]" For example:"projects/my-project/locations/global/buckets/my-
|
---|
69 | * bucket/views/my-view"
|
---|
70 | * @param array $optParams Optional parameters.
|
---|
71 | * @return LoggingEmpty
|
---|
72 | * @throws \Google\Service\Exception
|
---|
73 | */
|
---|
74 | public function delete($name, $optParams = [])
|
---|
75 | {
|
---|
76 | $params = ['name' => $name];
|
---|
77 | $params = array_merge($params, $optParams);
|
---|
78 | return $this->call('delete', [$params], LoggingEmpty::class);
|
---|
79 | }
|
---|
80 | /**
|
---|
81 | * Gets a view on a log bucket. (views.get)
|
---|
82 | *
|
---|
83 | * @param string $name Required. The resource name of the policy: "projects/[PRO
|
---|
84 | * JECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" For
|
---|
85 | * example:"projects/my-project/locations/global/buckets/my-bucket/views/my-
|
---|
86 | * view"
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return LogView
|
---|
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], LogView::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
99 | * resource exists and does not have a policy set. (views.getIamPolicy)
|
---|
100 | *
|
---|
101 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
102 | * requested. See Resource names
|
---|
103 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
104 | * value for this field.
|
---|
105 | * @param GetIamPolicyRequest $postBody
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | * @return Policy
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
115 | }
|
---|
116 | /**
|
---|
117 | * Lists views on a log bucket. (views.listLocationsBucketsViews)
|
---|
118 | *
|
---|
119 | * @param string $parent Required. The bucket whose views are to be listed:
|
---|
120 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | *
|
---|
123 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
124 | * from this request.Non-positive values are ignored. The presence of
|
---|
125 | * nextPageToken in the response indicates that more results might be available.
|
---|
126 | * @opt_param string pageToken Optional. If present, then retrieve the next
|
---|
127 | * batch of results from the preceding call to this method. pageToken must be
|
---|
128 | * the value of nextPageToken from the previous response. The values of other
|
---|
129 | * method parameters should be identical to those in the previous call.
|
---|
130 | * @return ListViewsResponse
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function listLocationsBucketsViews($parent, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['parent' => $parent];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('list', [$params], ListViewsResponse::class);
|
---|
138 | }
|
---|
139 | /**
|
---|
140 | * Updates a view on a log bucket. This method replaces the value of the filter
|
---|
141 | * field from the existing view with the corresponding value from the new view.
|
---|
142 | * If an UNAVAILABLE error is returned, this indicates that system is not in a
|
---|
143 | * state where it can update the view. If this occurs, please try again in a few
|
---|
144 | * minutes. (views.patch)
|
---|
145 | *
|
---|
146 | * @param string $name Required. The full resource name of the view to update "p
|
---|
147 | * rojects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_
|
---|
148 | * ID]" For example:"projects/my-project/locations/global/buckets/my-
|
---|
149 | * bucket/views/my-view"
|
---|
150 | * @param LogView $postBody
|
---|
151 | * @param array $optParams Optional parameters.
|
---|
152 | *
|
---|
153 | * @opt_param string updateMask Optional. Field mask that specifies the fields
|
---|
154 | * in view that need an update. A field will be overwritten if, and only if, it
|
---|
155 | * is in the update mask. name and output only fields cannot be updated.For a
|
---|
156 | * detailed FieldMask definition, see https://developers.google.com/protocol-
|
---|
157 | * buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example:
|
---|
158 | * updateMask=filter
|
---|
159 | * @return LogView
|
---|
160 | * @throws \Google\Service\Exception
|
---|
161 | */
|
---|
162 | public function patch($name, LogView $postBody, $optParams = [])
|
---|
163 | {
|
---|
164 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
165 | $params = array_merge($params, $optParams);
|
---|
166 | return $this->call('patch', [$params], LogView::class);
|
---|
167 | }
|
---|
168 | /**
|
---|
169 | * Sets the access control policy on the specified resource. Replaces any
|
---|
170 | * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
|
---|
171 | * errors. (views.setIamPolicy)
|
---|
172 | *
|
---|
173 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
174 | * specified. See Resource names
|
---|
175 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
176 | * value for this field.
|
---|
177 | * @param SetIamPolicyRequest $postBody
|
---|
178 | * @param array $optParams Optional parameters.
|
---|
179 | * @return Policy
|
---|
180 | * @throws \Google\Service\Exception
|
---|
181 | */
|
---|
182 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
183 | {
|
---|
184 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
185 | $params = array_merge($params, $optParams);
|
---|
186 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
187 | }
|
---|
188 | /**
|
---|
189 | * Returns permissions that a caller has on the specified resource. If the
|
---|
190 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
191 | * NOT_FOUND error.Note: This operation is designed to be used for building
|
---|
192 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
193 | * This operation may "fail open" without warning. (views.testIamPermissions)
|
---|
194 | *
|
---|
195 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
196 | * being requested. See Resource names
|
---|
197 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
198 | * value for this field.
|
---|
199 | * @param TestIamPermissionsRequest $postBody
|
---|
200 | * @param array $optParams Optional parameters.
|
---|
201 | * @return TestIamPermissionsResponse
|
---|
202 | * @throws \Google\Service\Exception
|
---|
203 | */
|
---|
204 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
205 | {
|
---|
206 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
207 | $params = array_merge($params, $optParams);
|
---|
208 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
209 | }
|
---|
210 | }
|
---|
211 |
|
---|
212 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
213 | class_alias(LocationsBucketsViews::class, 'Google_Service_Logging_Resource_LocationsBucketsViews');
|
---|