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