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\CopyLogEntriesRequest;
21use Google\Service\Logging\ListLogEntriesRequest;
22use Google\Service\Logging\ListLogEntriesResponse;
23use Google\Service\Logging\Operation;
24use Google\Service\Logging\TailLogEntriesRequest;
25use Google\Service\Logging\TailLogEntriesResponse;
26use Google\Service\Logging\WriteLogEntriesRequest;
27use Google\Service\Logging\WriteLogEntriesResponse;
28
29/**
30 * The "entries" collection of methods.
31 * Typical usage is:
32 *  <code>
33 *   $loggingService = new Google\Service\Logging(...);
34 *   $entries = $loggingService->entries;
35 *  </code>
36 */
37class Entries extends \Google\Service\Resource
38{
39  /**
40   * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
41   * (entries.copy)
42   *
43   * @param CopyLogEntriesRequest $postBody
44   * @param array $optParams Optional parameters.
45   * @return Operation
46   */
47  public function copy(CopyLogEntriesRequest $postBody, $optParams = [])
48  {
49    $params = ['postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('copy', [$params], Operation::class);
52  }
53  /**
54   * Lists log entries. Use this method to retrieve log entries that originated
55   * from a project/folder/organization/billing account. For ways to export log
56   * entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).
57   * (entries.listEntries)
58   *
59   * @param ListLogEntriesRequest $postBody
60   * @param array $optParams Optional parameters.
61   * @return ListLogEntriesResponse
62   */
63  public function listEntries(ListLogEntriesRequest $postBody, $optParams = [])
64  {
65    $params = ['postBody' => $postBody];
66    $params = array_merge($params, $optParams);
67    return $this->call('list', [$params], ListLogEntriesResponse::class);
68  }
69  /**
70   * Streaming read of log entries as they are ingested. Until the stream is
71   * terminated, it will continue reading logs. (entries.tail)
72   *
73   * @param TailLogEntriesRequest $postBody
74   * @param array $optParams Optional parameters.
75   * @return TailLogEntriesResponse
76   */
77  public function tail(TailLogEntriesRequest $postBody, $optParams = [])
78  {
79    $params = ['postBody' => $postBody];
80    $params = array_merge($params, $optParams);
81    return $this->call('tail', [$params], TailLogEntriesResponse::class);
82  }
83  /**
84   * Writes log entries to Logging. This API method is the only way to send log
85   * entries to Logging. This method is used, directly or indirectly, by the
86   * Logging agent (fluentd) and all logging libraries configured to use Logging.
87   * A single request may contain log entries for a maximum of 1000 different
88   * resources (projects, organizations, billing accounts or folders)
89   * (entries.write)
90   *
91   * @param WriteLogEntriesRequest $postBody
92   * @param array $optParams Optional parameters.
93   * @return WriteLogEntriesResponse
94   */
95  public function write(WriteLogEntriesRequest $postBody, $optParams = [])
96  {
97    $params = ['postBody' => $postBody];
98    $params = array_merge($params, $optParams);
99    return $this->call('write', [$params], WriteLogEntriesResponse::class);
100  }
101}
102
103// Adding a class alias for backwards compatibility with the previous class name.
104class_alias(Entries::class, 'Google_Service_Logging_Resource_Entries');
105