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\Volume;
|
---|
21 | use Google\Service\Books\Volumes as VolumesModel;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "volumes" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $booksService = new Google\Service\Books(...);
|
---|
28 | * $volumes = $booksService->volumes;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Volumes extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Gets volume information for a single volume. (volumes.get)
|
---|
35 | *
|
---|
36 | * @param string $volumeId ID of volume to retrieve.
|
---|
37 | * @param array $optParams Optional parameters.
|
---|
38 | *
|
---|
39 | * @opt_param string country ISO-3166-1 code to override the IP-based location.
|
---|
40 | * @opt_param bool includeNonComicsSeries Set to true to include non-comics
|
---|
41 | * series. Defaults to false.
|
---|
42 | * @opt_param string partner Brand results for partner ID.
|
---|
43 | * @opt_param string projection Restrict information returned to a set of
|
---|
44 | * selected fields.
|
---|
45 | * @opt_param string source string to identify the originator of this request.
|
---|
46 | * @opt_param bool user_library_consistent_read
|
---|
47 | * @return Volume
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function get($volumeId, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['volumeId' => $volumeId];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('get', [$params], Volume::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Performs a book search. (volumes.listVolumes)
|
---|
58 | *
|
---|
59 | * @param string $q Full-text search query string.
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | *
|
---|
62 | * @opt_param string download Restrict to volumes by download availability.
|
---|
63 | * @opt_param string filter Filter search results.
|
---|
64 | * @opt_param string langRestrict Restrict results to books with this language
|
---|
65 | * code.
|
---|
66 | * @opt_param string libraryRestrict Restrict search to this user's library.
|
---|
67 | * @opt_param string maxAllowedMaturityRating The maximum allowed maturity
|
---|
68 | * rating of returned recommendations. Books with a higher maturity rating are
|
---|
69 | * filtered out.
|
---|
70 | * @opt_param string maxResults Maximum number of results to return.
|
---|
71 | * @opt_param string orderBy Sort search results.
|
---|
72 | * @opt_param string partner Restrict and brand results for partner ID.
|
---|
73 | * @opt_param string printType Restrict to books or magazines.
|
---|
74 | * @opt_param string projection Restrict information returned to a set of
|
---|
75 | * selected fields.
|
---|
76 | * @opt_param bool showPreorders Set to true to show books available for
|
---|
77 | * preorder. Defaults to false.
|
---|
78 | * @opt_param string source String to identify the originator of this request.
|
---|
79 | * @opt_param string startIndex Index of the first result to return (starts at
|
---|
80 | * 0)
|
---|
81 | * @return VolumesModel
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function listVolumes($q, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['q' => $q];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('list', [$params], VolumesModel::class);
|
---|
89 | }
|
---|
90 | }
|
---|
91 |
|
---|
92 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
93 | class_alias(Volumes::class, 'Google_Service_Books_Resource_Volumes');
|
---|