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