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\Bookshelf;
22use Google\Service\Books\Bookshelves as BookshelvesModel;
23
24/**
25 * The "bookshelves" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $booksService = new Google\Service\Books(...);
29 *   $bookshelves = $booksService->bookshelves;
30 *  </code>
31 */
32class MylibraryBookshelves extends \Google\Service\Resource
33{
34  /**
35   * Adds a volume to a bookshelf. (bookshelves.addVolume)
36   *
37   * @param string $shelf ID of bookshelf to which to add a volume.
38   * @param string $volumeId ID of volume to add.
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string reason The reason for which the book is added to the
42   * library.
43   * @opt_param string source String to identify the originator of this request.
44   * @return BooksEmpty
45   */
46  public function addVolume($shelf, $volumeId, $optParams = [])
47  {
48    $params = ['shelf' => $shelf, 'volumeId' => $volumeId];
49    $params = array_merge($params, $optParams);
50    return $this->call('addVolume', [$params], BooksEmpty::class);
51  }
52  /**
53   * Clears all volumes from a bookshelf. (bookshelves.clearVolumes)
54   *
55   * @param string $shelf ID of bookshelf from which to remove a volume.
56   * @param array $optParams Optional parameters.
57   *
58   * @opt_param string source String to identify the originator of this request.
59   * @return BooksEmpty
60   */
61  public function clearVolumes($shelf, $optParams = [])
62  {
63    $params = ['shelf' => $shelf];
64    $params = array_merge($params, $optParams);
65    return $this->call('clearVolumes', [$params], BooksEmpty::class);
66  }
67  /**
68   * Retrieves metadata for a specific bookshelf belonging to the authenticated
69   * user. (bookshelves.get)
70   *
71   * @param string $shelf ID of bookshelf to retrieve.
72   * @param array $optParams Optional parameters.
73   *
74   * @opt_param string source String to identify the originator of this request.
75   * @return Bookshelf
76   */
77  public function get($shelf, $optParams = [])
78  {
79    $params = ['shelf' => $shelf];
80    $params = array_merge($params, $optParams);
81    return $this->call('get', [$params], Bookshelf::class);
82  }
83  /**
84   * Retrieves a list of bookshelves belonging to the authenticated user.
85   * (bookshelves.listMylibraryBookshelves)
86   *
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param string source String to identify the originator of this request.
90   * @return Bookshelves
91   */
92  public function listMylibraryBookshelves($optParams = [])
93  {
94    $params = [];
95    $params = array_merge($params, $optParams);
96    return $this->call('list', [$params], BookshelvesModel::class);
97  }
98  /**
99   * Moves a volume within a bookshelf. (bookshelves.moveVolume)
100   *
101   * @param string $shelf ID of bookshelf with the volume.
102   * @param string $volumeId ID of volume to move.
103   * @param int $volumePosition Position on shelf to move the item (0 puts the
104   * item before the current first item, 1 puts it between the first and the
105   * second and so on.)
106   * @param array $optParams Optional parameters.
107   *
108   * @opt_param string source String to identify the originator of this request.
109   * @return BooksEmpty
110   */
111  public function moveVolume($shelf, $volumeId, $volumePosition, $optParams = [])
112  {
113    $params = ['shelf' => $shelf, 'volumeId' => $volumeId, 'volumePosition' => $volumePosition];
114    $params = array_merge($params, $optParams);
115    return $this->call('moveVolume', [$params], BooksEmpty::class);
116  }
117  /**
118   * Removes a volume from a bookshelf. (bookshelves.removeVolume)
119   *
120   * @param string $shelf ID of bookshelf from which to remove a volume.
121   * @param string $volumeId ID of volume to remove.
122   * @param array $optParams Optional parameters.
123   *
124   * @opt_param string reason The reason for which the book is removed from the
125   * library.
126   * @opt_param string source String to identify the originator of this request.
127   * @return BooksEmpty
128   */
129  public function removeVolume($shelf, $volumeId, $optParams = [])
130  {
131    $params = ['shelf' => $shelf, 'volumeId' => $volumeId];
132    $params = array_merge($params, $optParams);
133    return $this->call('removeVolume', [$params], BooksEmpty::class);
134  }
135}
136
137// Adding a class alias for backwards compatibility with the previous class name.
138class_alias(MylibraryBookshelves::class, 'Google_Service_Books_Resource_MylibraryBookshelves');
139