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\PubsubLite\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\PubsubLite\ComputeHeadCursorRequest;
|
---|
21 | use Google\Service\PubsubLite\ComputeHeadCursorResponse;
|
---|
22 | use Google\Service\PubsubLite\ComputeMessageStatsRequest;
|
---|
23 | use Google\Service\PubsubLite\ComputeMessageStatsResponse;
|
---|
24 | use Google\Service\PubsubLite\ComputeTimeCursorRequest;
|
---|
25 | use Google\Service\PubsubLite\ComputeTimeCursorResponse;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "topics" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $pubsubliteService = new Google\Service\PubsubLite(...);
|
---|
32 | * $topics = $pubsubliteService->topicStats_projects_locations_topics;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class TopicStatsProjectsLocationsTopics extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Compute the head cursor for the partition. The head cursor's offset is
|
---|
39 | * guaranteed to be less than or equal to all messages which have not yet been
|
---|
40 | * acknowledged as published, and greater than the offset of any message whose
|
---|
41 | * publish has already been acknowledged. It is zero if there have never been
|
---|
42 | * messages in the partition. (topics.computeHeadCursor)
|
---|
43 | *
|
---|
44 | * @param string $topic Required. The topic for which we should compute the head
|
---|
45 | * cursor.
|
---|
46 | * @param ComputeHeadCursorRequest $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | * @return ComputeHeadCursorResponse
|
---|
49 | * @throws \Google\Service\Exception
|
---|
50 | */
|
---|
51 | public function computeHeadCursor($topic, ComputeHeadCursorRequest $postBody, $optParams = [])
|
---|
52 | {
|
---|
53 | $params = ['topic' => $topic, 'postBody' => $postBody];
|
---|
54 | $params = array_merge($params, $optParams);
|
---|
55 | return $this->call('computeHeadCursor', [$params], ComputeHeadCursorResponse::class);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Compute statistics about a range of messages in a given topic and partition.
|
---|
59 | * (topics.computeMessageStats)
|
---|
60 | *
|
---|
61 | * @param string $topic Required. The topic for which we should compute message
|
---|
62 | * stats.
|
---|
63 | * @param ComputeMessageStatsRequest $postBody
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | * @return ComputeMessageStatsResponse
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function computeMessageStats($topic, ComputeMessageStatsRequest $postBody, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['topic' => $topic, 'postBody' => $postBody];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('computeMessageStats', [$params], ComputeMessageStatsResponse::class);
|
---|
73 | }
|
---|
74 | /**
|
---|
75 | * Compute the corresponding cursor for a publish or event time in a topic
|
---|
76 | * partition. (topics.computeTimeCursor)
|
---|
77 | *
|
---|
78 | * @param string $topic Required. The topic for which we should compute the
|
---|
79 | * cursor.
|
---|
80 | * @param ComputeTimeCursorRequest $postBody
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | * @return ComputeTimeCursorResponse
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function computeTimeCursor($topic, ComputeTimeCursorRequest $postBody, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['topic' => $topic, 'postBody' => $postBody];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('computeTimeCursor', [$params], ComputeTimeCursorResponse::class);
|
---|
90 | }
|
---|
91 | }
|
---|
92 |
|
---|
93 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
94 | class_alias(TopicStatsProjectsLocationsTopics::class, 'Google_Service_PubsubLite_Resource_TopicStatsProjectsLocationsTopics');
|
---|