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