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\ListLogsResponse;
21use Google\Service\Logging\LoggingEmpty;
22
23/**
24 * The "logs" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $loggingService = new Google\Service\Logging(...);
28 *   $logs = $loggingService->logs;
29 *  </code>
30 */
31class BillingAccountsLogs extends \Google\Service\Resource
32{
33  /**
34   * Deletes all the log entries in a log for the _Default Log Bucket. The log
35   * reappears if it receives new entries. Log entries written shortly before the
36   * delete operation might not be deleted. Entries received after the delete
37   * operation with a timestamp before the operation will be deleted.
38   * (logs.delete)
39   *
40   * @param string $logName Required. The resource name of the log to delete:
41   * projects/[PROJECT_ID]/logs/[LOG_ID]
42   * organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
43   * billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
44   * folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example,
45   * "projects/my-project-id/logs/syslog",
46   * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For more
47   * information about log names, see LogEntry.
48   * @param array $optParams Optional parameters.
49   * @return LoggingEmpty
50   */
51  public function delete($logName, $optParams = [])
52  {
53    $params = ['logName' => $logName];
54    $params = array_merge($params, $optParams);
55    return $this->call('delete', [$params], LoggingEmpty::class);
56  }
57  /**
58   * Lists the logs in projects, organizations, folders, or billing accounts. Only
59   * logs that have entries are listed. (logs.listBillingAccountsLogs)
60   *
61   * @param string $parent Required. The resource name that owns the logs:
62   * projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
63   * billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
64   * @param array $optParams Optional parameters.
65   *
66   * @opt_param int pageSize Optional. The maximum number of results to return
67   * from this request. Non-positive values are ignored. The presence of
68   * nextPageToken in the response indicates that more results might be available.
69   * @opt_param string pageToken Optional. If present, then retrieve the next
70   * batch of results from the preceding call to this method. pageToken must be
71   * the value of nextPageToken from the previous response. The values of other
72   * method parameters should be identical to those in the previous call.
73   * @opt_param string resourceNames Optional. The resource name that owns the
74   * logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views
75   * /[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[B
76   * UCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOC
77   * ATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[
78   * LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it
79   * could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
80   * billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
81   * @return ListLogsResponse
82   */
83  public function listBillingAccountsLogs($parent, $optParams = [])
84  {
85    $params = ['parent' => $parent];
86    $params = array_merge($params, $optParams);
87    return $this->call('list', [$params], ListLogsResponse::class);
88  }
89}
90
91// Adding a class alias for backwards compatibility with the previous class name.
92class_alias(BillingAccountsLogs::class, 'Google_Service_Logging_Resource_BillingAccountsLogs');
93