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\Books\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Books\BooksEmpty;
|
---|
21 | use Google\Service\Books\ReadingPosition;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "readingpositions" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $booksService = new Google\Service\Books(...);
|
---|
28 | * $readingpositions = $booksService->mylibrary_readingpositions;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class MylibraryReadingpositions extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Retrieves my reading position information for a volume.
|
---|
35 | * (readingpositions.get)
|
---|
36 | *
|
---|
37 | * @param string $volumeId ID of volume for which to retrieve a reading
|
---|
38 | * position.
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | *
|
---|
41 | * @opt_param string contentVersion Volume content version for which this
|
---|
42 | * reading position is requested.
|
---|
43 | * @opt_param string source String to identify the originator of this request.
|
---|
44 | * @return ReadingPosition
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function get($volumeId, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['volumeId' => $volumeId];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('get', [$params], ReadingPosition::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Sets my reading position information for a volume.
|
---|
55 | * (readingpositions.setPosition)
|
---|
56 | *
|
---|
57 | * @param string $volumeId ID of volume for which to update the reading
|
---|
58 | * position.
|
---|
59 | * @param string $position Position string for the new volume reading position.
|
---|
60 | * @param string $timestamp RFC 3339 UTC format timestamp associated with this
|
---|
61 | * reading position.
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | *
|
---|
64 | * @opt_param string action Action that caused this reading position to be set.
|
---|
65 | * @opt_param string contentVersion Volume content version for which this
|
---|
66 | * reading position applies.
|
---|
67 | * @opt_param string deviceCookie Random persistent device cookie optional on
|
---|
68 | * set position.
|
---|
69 | * @opt_param string source String to identify the originator of this request.
|
---|
70 | * @return BooksEmpty
|
---|
71 | * @throws \Google\Service\Exception
|
---|
72 | */
|
---|
73 | public function setPosition($volumeId, $position, $timestamp, $optParams = [])
|
---|
74 | {
|
---|
75 | $params = ['volumeId' => $volumeId, 'position' => $position, 'timestamp' => $timestamp];
|
---|
76 | $params = array_merge($params, $optParams);
|
---|
77 | return $this->call('setPosition', [$params], BooksEmpty::class);
|
---|
78 | }
|
---|
79 | }
|
---|
80 |
|
---|
81 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
82 | class_alias(MylibraryReadingpositions::class, 'Google_Service_Books_Resource_MylibraryReadingpositions');
|
---|