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\Volume;
21use 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 */
31class 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   */
49  public function get($volumeId, $optParams = [])
50  {
51    $params = ['volumeId' => $volumeId];
52    $params = array_merge($params, $optParams);
53    return $this->call('get', [$params], Volume::class);
54  }
55  /**
56   * Performs a book search. (volumes.listVolumes)
57   *
58   * @param string $q Full-text search query string.
59   * @param array $optParams Optional parameters.
60   *
61   * @opt_param string download Restrict to volumes by download availability.
62   * @opt_param string filter Filter search results.
63   * @opt_param string langRestrict Restrict results to books with this language
64   * code.
65   * @opt_param string libraryRestrict Restrict search to this user's library.
66   * @opt_param string maxAllowedMaturityRating The maximum allowed maturity
67   * rating of returned recommendations. Books with a higher maturity rating are
68   * filtered out.
69   * @opt_param string maxResults Maximum number of results to return.
70   * @opt_param string orderBy Sort search results.
71   * @opt_param string partner Restrict and brand results for partner ID.
72   * @opt_param string printType Restrict to books or magazines.
73   * @opt_param string projection Restrict information returned to a set of
74   * selected fields.
75   * @opt_param bool showPreorders Set to true to show books available for
76   * preorder. Defaults to false.
77   * @opt_param string source String to identify the originator of this request.
78   * @opt_param string startIndex Index of the first result to return (starts at
79   * 0)
80   * @return VolumesModel
81   */
82  public function listVolumes($q, $optParams = [])
83  {
84    $params = ['q' => $q];
85    $params = array_merge($params, $optParams);
86    return $this->call('list', [$params], VolumesModel::class);
87  }
88}
89
90// Adding a class alias for backwards compatibility with the previous class name.
91class_alias(Volumes::class, 'Google_Service_Books_Resource_Volumes');
92