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\Logging\Resource; 19 20use Google\Service\Logging\ListViewsResponse; 21use Google\Service\Logging\LogView; 22use 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->views; 30 * </code> 31 */ 32class 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. The id to use for this view. 45 * @return LogView 46 */ 47 public function create($parent, LogView $postBody, $optParams = []) 48 { 49 $params = ['parent' => $parent, 'postBody' => $postBody]; 50 $params = array_merge($params, $optParams); 51 return $this->call('create', [$params], LogView::class); 52 } 53 /** 54 * Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this 55 * indicates that system is not in a state where it can delete the view. If this 56 * occurs, please try again in a few minutes. (views.delete) 57 * 58 * @param string $name Required. The full resource name of the view to delete: " 59 * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW 60 * _ID]" For example:"projects/my-project/locations/global/buckets/my- 61 * bucket/views/my-view" 62 * @param array $optParams Optional parameters. 63 * @return LoggingEmpty 64 */ 65 public function delete($name, $optParams = []) 66 { 67 $params = ['name' => $name]; 68 $params = array_merge($params, $optParams); 69 return $this->call('delete', [$params], LoggingEmpty::class); 70 } 71 /** 72 * Lists views on a log bucket. (views.listBillingAccountsLocationsBucketsViews) 73 * 74 * @param string $parent Required. The bucket whose views are to be listed: 75 * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 76 * @param array $optParams Optional parameters. 77 * 78 * @opt_param int pageSize Optional. The maximum number of results to return 79 * from this request.Non-positive values are ignored. The presence of 80 * nextPageToken in the response indicates that more results might be available. 81 * @opt_param string pageToken Optional. If present, then retrieve the next 82 * batch of results from the preceding call to this method. pageToken must be 83 * the value of nextPageToken from the previous response. The values of other 84 * method parameters should be identical to those in the previous call. 85 * @return ListViewsResponse 86 */ 87 public function listBillingAccountsLocationsBucketsViews($parent, $optParams = []) 88 { 89 $params = ['parent' => $parent]; 90 $params = array_merge($params, $optParams); 91 return $this->call('list', [$params], ListViewsResponse::class); 92 } 93 /** 94 * Updates a view on a log bucket. This method replaces the following fields in 95 * the existing view with values from the new view: filter. If an UNAVAILABLE 96 * error is returned, this indicates that system is not in a state where it can 97 * update the view. If this occurs, please try again in a few minutes. 98 * (views.patch) 99 * 100 * @param string $name Required. The full resource name of the view to update "p 101 * rojects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ 102 * ID]" For example:"projects/my-project/locations/global/buckets/my- 103 * bucket/views/my-view" 104 * @param LogView $postBody 105 * @param array $optParams Optional parameters. 106 * 107 * @opt_param string updateMask Optional. Field mask that specifies the fields 108 * in view that need an update. A field will be overwritten if, and only if, it 109 * is in the update mask. name and output only fields cannot be updated.For a 110 * detailed FieldMask definition, see https://developers.google.com/protocol- 111 * buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: 112 * updateMask=filter 113 * @return LogView 114 */ 115 public function patch($name, LogView $postBody, $optParams = []) 116 { 117 $params = ['name' => $name, 'postBody' => $postBody]; 118 $params = array_merge($params, $optParams); 119 return $this->call('patch', [$params], LogView::class); 120 } 121} 122 123// Adding a class alias for backwards compatibility with the previous class name. 124class_alias(BillingAccountsLocationsBucketsViews::class, 'Google_Service_Logging_Resource_BillingAccountsLocationsBucketsViews'); 125