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\DownloadAccesses;
21use Google\Service\Books\RequestAccessData;
22use Google\Service\Books\Usersettings;
23use Google\Service\Books\Volumes as VolumesModel;
24
25/**
26 * The "myconfig" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $booksService = new Google\Service\Books(...);
30 *   $myconfig = $booksService->myconfig;
31 *  </code>
32 */
33class Myconfig extends \Google\Service\Resource
34{
35  /**
36   * Gets the current settings for the user. (myconfig.getUserSettings)
37   *
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string country Unused. Added only to workaround TEX mandatory
41   * request template requirement
42   * @return Usersettings
43   */
44  public function getUserSettings($optParams = [])
45  {
46    $params = [];
47    $params = array_merge($params, $optParams);
48    return $this->call('getUserSettings', [$params], Usersettings::class);
49  }
50  /**
51   * Release downloaded content access restriction.
52   * (myconfig.releaseDownloadAccess)
53   *
54   * @param string $cpksver The device/version ID from which to release the
55   * restriction.
56   * @param string|array $volumeIds The volume(s) to release restrictions for.
57   * @param array $optParams Optional parameters.
58   *
59   * @opt_param string locale ISO-639-1, ISO-3166-1 codes for message
60   * localization, i.e. en_US.
61   * @opt_param string source String to identify the originator of this request.
62   * @return DownloadAccesses
63   */
64  public function releaseDownloadAccess($cpksver, $volumeIds, $optParams = [])
65  {
66    $params = ['cpksver' => $cpksver, 'volumeIds' => $volumeIds];
67    $params = array_merge($params, $optParams);
68    return $this->call('releaseDownloadAccess', [$params], DownloadAccesses::class);
69  }
70  /**
71   * Request concurrent and download access restrictions. (myconfig.requestAccess)
72   *
73   * @param string $cpksver The device/version ID from which to request the
74   * restrictions.
75   * @param string $nonce The client nonce value.
76   * @param string $source String to identify the originator of this request.
77   * @param string $volumeId The volume to request concurrent/download
78   * restrictions for.
79   * @param array $optParams Optional parameters.
80   *
81   * @opt_param string licenseTypes The type of access license to request. If not
82   * specified, the default is BOTH.
83   * @opt_param string locale ISO-639-1, ISO-3166-1 codes for message
84   * localization, i.e. en_US.
85   * @return RequestAccessData
86   */
87  public function requestAccess($cpksver, $nonce, $source, $volumeId, $optParams = [])
88  {
89    $params = ['cpksver' => $cpksver, 'nonce' => $nonce, 'source' => $source, 'volumeId' => $volumeId];
90    $params = array_merge($params, $optParams);
91    return $this->call('requestAccess', [$params], RequestAccessData::class);
92  }
93  /**
94   * Request downloaded content access for specified volumes on the My eBooks
95   * shelf. (myconfig.syncVolumeLicenses)
96   *
97   * @param string $cpksver The device/version ID from which to release the
98   * restriction.
99   * @param string $nonce The client nonce value.
100   * @param string $source String to identify the originator of this request.
101   * @param array $optParams Optional parameters.
102   *
103   * @opt_param string features List of features supported by the client, i.e.,
104   * 'RENTALS'
105   * @opt_param bool includeNonComicsSeries Set to true to include non-comics
106   * series. Defaults to false.
107   * @opt_param string locale ISO-639-1, ISO-3166-1 codes for message
108   * localization, i.e. en_US.
109   * @opt_param bool showPreorders Set to true to show pre-ordered books. Defaults
110   * to false.
111   * @opt_param string volumeIds The volume(s) to request download restrictions
112   * for.
113   * @return Volumes
114   */
115  public function syncVolumeLicenses($cpksver, $nonce, $source, $optParams = [])
116  {
117    $params = ['cpksver' => $cpksver, 'nonce' => $nonce, 'source' => $source];
118    $params = array_merge($params, $optParams);
119    return $this->call('syncVolumeLicenses', [$params], VolumesModel::class);
120  }
121  /**
122   * Sets the settings for the user. If a sub-object is specified, it will
123   * overwrite the existing sub-object stored in the server. Unspecified sub-
124   * objects will retain the existing value. (myconfig.updateUserSettings)
125   *
126   * @param Usersettings $postBody
127   * @param array $optParams Optional parameters.
128   * @return Usersettings
129   */
130  public function updateUserSettings(Usersettings $postBody, $optParams = [])
131  {
132    $params = ['postBody' => $postBody];
133    $params = array_merge($params, $optParams);
134    return $this->call('updateUserSettings', [$params], Usersettings::class);
135  }
136}
137
138// Adding a class alias for backwards compatibility with the previous class name.
139class_alias(Myconfig::class, 'Google_Service_Books_Resource_Myconfig');
140