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\ListExclusionsResponse; 21use Google\Service\Logging\LogExclusion; 22use Google\Service\Logging\LoggingEmpty; 23 24/** 25 * The "exclusions" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $loggingService = new Google\Service\Logging(...); 29 * $exclusions = $loggingService->exclusions; 30 * </code> 31 */ 32class ProjectsExclusions extends \Google\Service\Resource 33{ 34 /** 35 * Creates a new exclusion in the _Default sink in a specified parent resource. 36 * Only log entries belonging to that resource can be excluded. You can have up 37 * to 10 exclusions in a resource. (exclusions.create) 38 * 39 * @param string $parent Required. The parent resource in which to create the 40 * exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" 41 * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For 42 * examples:"projects/my-logging-project" "organizations/123456789" 43 * @param LogExclusion $postBody 44 * @param array $optParams Optional parameters. 45 * @return LogExclusion 46 */ 47 public function create($parent, LogExclusion $postBody, $optParams = []) 48 { 49 $params = ['parent' => $parent, 'postBody' => $postBody]; 50 $params = array_merge($params, $optParams); 51 return $this->call('create', [$params], LogExclusion::class); 52 } 53 /** 54 * Deletes an exclusion in the _Default sink. (exclusions.delete) 55 * 56 * @param string $name Required. The resource name of an existing exclusion to 57 * delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 58 * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 59 * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 60 * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For example:"projects/my- 61 * project/exclusions/my-exclusion" 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 * Gets the description of an exclusion in the _Default sink. (exclusions.get) 73 * 74 * @param string $name Required. The resource name of an existing exclusion: 75 * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 76 * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 77 * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 78 * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For example:"projects/my- 79 * project/exclusions/my-exclusion" 80 * @param array $optParams Optional parameters. 81 * @return LogExclusion 82 */ 83 public function get($name, $optParams = []) 84 { 85 $params = ['name' => $name]; 86 $params = array_merge($params, $optParams); 87 return $this->call('get', [$params], LogExclusion::class); 88 } 89 /** 90 * Lists all the exclusions on the _Default sink in a parent resource. 91 * (exclusions.listProjectsExclusions) 92 * 93 * @param string $parent Required. The parent resource whose exclusions are to 94 * be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" 95 * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" 96 * @param array $optParams Optional parameters. 97 * 98 * @opt_param int pageSize Optional. The maximum number of results to return 99 * from this request. Non-positive values are ignored. The presence of 100 * nextPageToken in the response indicates that more results might be available. 101 * @opt_param string pageToken Optional. If present, then retrieve the next 102 * batch of results from the preceding call to this method. pageToken must be 103 * the value of nextPageToken from the previous response. The values of other 104 * method parameters should be identical to those in the previous call. 105 * @return ListExclusionsResponse 106 */ 107 public function listProjectsExclusions($parent, $optParams = []) 108 { 109 $params = ['parent' => $parent]; 110 $params = array_merge($params, $optParams); 111 return $this->call('list', [$params], ListExclusionsResponse::class); 112 } 113 /** 114 * Changes one or more properties of an existing exclusion in the _Default sink. 115 * (exclusions.patch) 116 * 117 * @param string $name Required. The resource name of the exclusion to update: 118 * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 119 * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 120 * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 121 * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For example:"projects/my- 122 * project/exclusions/my-exclusion" 123 * @param LogExclusion $postBody 124 * @param array $optParams Optional parameters. 125 * 126 * @opt_param string updateMask Required. A non-empty list of fields to change 127 * in the existing exclusion. New values for the fields are taken from the 128 * corresponding fields in the LogExclusion included in this request. Fields not 129 * mentioned in update_mask are not changed and are ignored in the request.For 130 * example, to change the filter and description of an exclusion, specify an 131 * update_mask of "filter,description". 132 * @return LogExclusion 133 */ 134 public function patch($name, LogExclusion $postBody, $optParams = []) 135 { 136 $params = ['name' => $name, 'postBody' => $postBody]; 137 $params = array_merge($params, $optParams); 138 return $this->call('patch', [$params], LogExclusion::class); 139 } 140} 141 142// Adding a class alias for backwards compatibility with the previous class name. 143class_alias(ProjectsExclusions::class, 'Google_Service_Logging_Resource_ProjectsExclusions'); 144