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\ListViewsResponse;
|
---|
21 | use Google\Service\Logging\LogView;
|
---|
22 | use Google\Service\Logging\LoggingEmpty;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "views" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $loggingService = new Google\Service\Logging(...);
|
---|
29 | * $views = $loggingService->billingAccounts_locations_buckets_views;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class BillingAccountsLocationsBucketsViews extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a view over log entries in a log bucket. A bucket may contain a
|
---|
36 | * maximum of 30 views. (views.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The bucket in which to create the view
|
---|
39 | * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` For
|
---|
40 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
41 | * @param LogView $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | *
|
---|
44 | * @opt_param string viewId Required. A client-assigned identifier such as "my-
|
---|
45 | * view". Identifiers are limited to 100 characters and can include only
|
---|
46 | * letters, digits, underscores, hyphens, and periods.
|
---|
47 | * @return LogView
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function create($parent, LogView $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('create', [$params], LogView::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this
|
---|
58 | * indicates that system is not in a state where it can delete the view. If this
|
---|
59 | * occurs, please try again in a few minutes. (views.delete)
|
---|
60 | *
|
---|
61 | * @param string $name Required. The full resource name of the view to delete: "
|
---|
62 | * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW
|
---|
63 | * _ID]" For example:"projects/my-project/locations/global/buckets/my-
|
---|
64 | * bucket/views/my-view"
|
---|
65 | * @param array $optParams Optional parameters.
|
---|
66 | * @return LoggingEmpty
|
---|
67 | * @throws \Google\Service\Exception
|
---|
68 | */
|
---|
69 | public function delete($name, $optParams = [])
|
---|
70 | {
|
---|
71 | $params = ['name' => $name];
|
---|
72 | $params = array_merge($params, $optParams);
|
---|
73 | return $this->call('delete', [$params], LoggingEmpty::class);
|
---|
74 | }
|
---|
75 | /**
|
---|
76 | * Gets a view on a log bucket. (views.get)
|
---|
77 | *
|
---|
78 | * @param string $name Required. The resource name of the policy: "projects/[PRO
|
---|
79 | * JECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" For
|
---|
80 | * example:"projects/my-project/locations/global/buckets/my-bucket/views/my-
|
---|
81 | * view"
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | * @return LogView
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function get($name, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['name' => $name];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('get', [$params], LogView::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Lists views on a log bucket. (views.listBillingAccountsLocationsBucketsViews)
|
---|
94 | *
|
---|
95 | * @param string $parent Required. The bucket whose views are to be listed:
|
---|
96 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | *
|
---|
99 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
100 | * from this request.Non-positive values are ignored. The presence of
|
---|
101 | * nextPageToken in the response indicates that more results might be available.
|
---|
102 | * @opt_param string pageToken Optional. If present, then retrieve the next
|
---|
103 | * batch of results from the preceding call to this method. pageToken must be
|
---|
104 | * the value of nextPageToken from the previous response. The values of other
|
---|
105 | * method parameters should be identical to those in the previous call.
|
---|
106 | * @return ListViewsResponse
|
---|
107 | * @throws \Google\Service\Exception
|
---|
108 | */
|
---|
109 | public function listBillingAccountsLocationsBucketsViews($parent, $optParams = [])
|
---|
110 | {
|
---|
111 | $params = ['parent' => $parent];
|
---|
112 | $params = array_merge($params, $optParams);
|
---|
113 | return $this->call('list', [$params], ListViewsResponse::class);
|
---|
114 | }
|
---|
115 | /**
|
---|
116 | * Updates a view on a log bucket. This method replaces the value of the filter
|
---|
117 | * field from the existing view with the corresponding value from the new view.
|
---|
118 | * If an UNAVAILABLE error is returned, this indicates that system is not in a
|
---|
119 | * state where it can update the view. If this occurs, please try again in a few
|
---|
120 | * minutes. (views.patch)
|
---|
121 | *
|
---|
122 | * @param string $name Required. The full resource name of the view to update "p
|
---|
123 | * rojects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_
|
---|
124 | * ID]" For example:"projects/my-project/locations/global/buckets/my-
|
---|
125 | * bucket/views/my-view"
|
---|
126 | * @param LogView $postBody
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | *
|
---|
129 | * @opt_param string updateMask Optional. Field mask that specifies the fields
|
---|
130 | * in view that need an update. A field will be overwritten if, and only if, it
|
---|
131 | * is in the update mask. name and output only fields cannot be updated.For a
|
---|
132 | * detailed FieldMask definition, see https://developers.google.com/protocol-
|
---|
133 | * buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example:
|
---|
134 | * updateMask=filter
|
---|
135 | * @return LogView
|
---|
136 | * @throws \Google\Service\Exception
|
---|
137 | */
|
---|
138 | public function patch($name, LogView $postBody, $optParams = [])
|
---|
139 | {
|
---|
140 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
141 | $params = array_merge($params, $optParams);
|
---|
142 | return $this->call('patch', [$params], LogView::class);
|
---|
143 | }
|
---|
144 | }
|
---|
145 |
|
---|
146 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
147 | class_alias(BillingAccountsLocationsBucketsViews::class, 'Google_Service_Logging_Resource_BillingAccountsLocationsBucketsViews');
|
---|